mBlock5 Extension - Create A Custom Button in Device Extension


#1

Hi everyone, I’m new here (as a writer)!

I’m currently working on developing my own extension for CyberPi, and things are going quite well—except for one thing I’m stuck on:

How do I create a clickable button that opens a custom window?
I want the button to open a small popup window (or any kind of panel) that can display either some text or an image.

Here’s the button I’m talking about:

I’ve been trying to get this to work for a while but haven’t had much success yet.

So my questions are:

How do I create a button like this in the extension UI?

How do I make it open a custom window with content inside (text or image)?

Are there any example extensions or documentation I should check out?

Any help or suggestions would be greatly appreciated. Thank you!


#2

I found an example using this extension where clicking a button triggers a pop-up window:

It’s a really nice widget!
I’d love to learn more about how it works. Could you please share example code or any documentation that shows how to implement something like this?

Thank you in advance!


#3

@PerfecXX
I’ve tried to do this myself several times and can never get it to work. I’m guessing it’s a security measure to limit it to only makeblock official extensions. If you want, I can privately send you the .mext file for an extension with a button like that that works, if it might help.


#4

Please send it to watit2013@gmail.com
I figured it out

Thank you


#5

Sent! :slight_smile: