Jump to content

[SOLVED] callback resolution, minor


photo

Recommended Posts

I have a bit inconvenient situation, where i do two calls in my function.

{

myComboBox->setcurrentItem(x);

myLabel->setText("hello");

}

myComboBox has a callback, which among other things clears myLabel.

 

Result is, that myLabel is cleared. I suspect it is because callbacks are resolved sometime during update phase of unigine operation and it overwrites the changes which you make immediately after. Its not difficult to workaround, but it would be nice, if you could somehow mark the callback for immediate execution instead of delayed one to avoid having to deal with this manually.

Link to comment

Hi!

There isn't way to mark it.

You can try temporary disable callback and execute it manually:

myComboBox->setCallbackEnabled(Gui::CHANGED, false);
myComboBox->setCurrentItem(i);
myComboBox->on_callback();
myComboBox->setCallbackEnabled(Gui::CHANGED, true);

 

Link to comment
  • silent changed the title to [SOLVED] callback resolution, minor
×
×
  • Create New...