Message Box or Popups display

I am new here and spent about 15 days with Squareline Studios and also planning to buy.

I have two question-

  1. Is there any Message box or popsup display option?
  2. is there any way to use 2 different theme in my ui like dark theme and light theme?

Thanks in advanced

Others

  • **SquareLine Studio version: 1.30
  • **Operating system: windows 11
  • **Target hardware: NXP MIMXRT1062

I am also a user that has subscribed for a few months now.

There is no message box feature built right into Squareline Studio as of now (v1.3.1). However, I managed to add just a few lines of code in its ui_events.c to make my own message box. The code is written according to LVGL official documentation about Message box (lv_msgbox).

For the second question, I have not used the light and dark theme feature yet. I do see there is an option in SLS to choose, but I have no idea how to use it.

1 Like

Hi,

Really there is no message box widget in SLS, but you can easily create one from the basic widgets and add convert the result into a component.

When you need to display a message box just unhide an instance of the component.

2 Likes

Or you can design a panel with background color (half transparency), and add your message box panel into this panel, then you got a perfect pop up messagebox with good display. But every time you need to unhide the top panel and the messagebox panel itself to achieve that.

1 Like

Thank you so much for reply, Currently i am using this technique. in a single screen i am using multiple panel for multiple message box by hide and unhide. but the question is that it is good idea? i mean is there any chance to loss performance?

Thanks

Hello christine,
Thank you so much for reply. if i added code manually in ui_events and again exports the code from SLS will not SLS modify the code and my code will disappear.

I am not sure, and i am not try yet. have you any experience?

Hi LeoChris
yes. i am using this technique. and hope that there should not be any performance issue.

1 Like

With the current functionality of SLS, I can think it’s the best option. If only the text changes on the message boxes, you can use a single message box and and use a SET PROPERTY action to change the text.

1 Like

if i added code manually in ui_events and again exports the code from SLS will not SLS modify the code and my code will disappear.

Yep, SLS will cover your code when you export. Therefore, my workflow is as follow:

  1. SLS project is put in a folder e.g. Project/Squareline.
  2. The code is put in the folder e.g. Project/src
  3. The UI code is put in the folder e.g. Project/src/main/ui

Everytime I export the code, the generated code is located in Project/Squareline. Then, I copy and paste the generated UI code to Project/src/main/ui. This might not be the most elegant way, but it works :joy:.

Let me know if there is a better way.