Jump to content

[SOLVED] Widgets callbacks and UI files


photo

Recommended Posts

Posted

Hello !

 

I would like to know if it's possible to make callbacks using UI files with the same capabilities as the scripted one.

 

For instance, with the script we could use the following declaration which includes some data arguments that could help a lot :

void setCallback(int callback,string function,variable data_0,variable data_1,variable data_2,variable data_3)

(Source https://developer.un...riable_variable)

 

On other hand, in UI files, this is the only declaration we have in the documentation :

callback
Sets a callback for the widget. Contains a name of the callback function.
Parameters: type, widget, string, accel_key, accel_ctrl, accel_alt.

(Source https://developer.un.../gui/ui_widgets)

 

Thank you !

Posted

Hello again,

 

i will ask something else if it's possible : could it be possible to add an engine.gui.saveUserInterface(UserInterface userInterface) method ?

 

Doing it this way we could update some states of user interface really easily.

 

Thanks !

Posted

In UI you can use string to pass your custom data, plus you can use 1 variable for that. I'll add this info into docs.

 

As for saving user interfaces, sorry, we do not plan to add this functionality. What is your use case for that?

Posted

The use case is to allow the user to save custom UI state directly in UI files.

 

This avoid to use exports Widgets to Unigine script and make some code to restore state from a previously saved XML file.

 

Will look into docs.

 

Thanks.

×
×
  • Create New...