Jump to content

Incomplete doc for widgets API


photo

Recommended Posts

Hello,

In the Widget API, what are exactly the arguments passed to these callbacks:

https://developer.unigine.com/en/docs/2.11/api/library/gui/class.widget?rlang=cpp#addCallback_int_Callback3_void_ptr

I couldn't figure out the second WidgetPtr and the int value passed.

Bonus question: in a radio button group, is it possible to know which radio is checked, without having to explicitly look at each one?

Thanks!

Link to comment

Hi!

4 hours ago, Amerio.Stephane said:

I couldn't figure out the second WidgetPtr and the int value passed.

pointer - is used for Drag&drop operations. For details see Widgets/spritre_03 in  SDK UnigineScript samples.

data - is used for getting of mouse or keyboard button state, when widget is pressed or clicked (callbacks names: Gui::CLICKED, Gui::PRESSED, Gui::KEY_PRESSED)

 

4 hours ago, Amerio.Stephane said:

Bonus question: in a radio button group, is it possible to know which radio is checked, without having to explicitly look at each one?

There aren't embedded ways to do it. But you can set one callback (from Gui::CHANGED) for all widgets in group.

Link to comment
×
×
  • Create New...