Search the Community
Showing results for tags 'callbacks'.
-
widgetbutton В 2.18 версии отсутствует метод addCallback в WidgetButton, устаревшая документация
Nehuhry posted a topic in Documentation
Добрый вечер! В документации на WidgetButton устаревшая информация. Вызов привязки обработчика события клика на кнопку теперь выглядит таким образом: Было: m_btn->addCallback(Gui::CLICKED, MakeCallback(onButtonClicked)); Стало: m_btn->getEventClicked().connect(this, &BaseHUD::onButtonClicked); -
Hi, We're getting an error on a garbage collected delegate in our UI. The UI is dynamically created by our UI manager on startup and we hold a copy of all the objects within the UI manager to stop them being garbage collected. In this case, it's on a WidgetSprite that we've added callbacks for mouse enter and leave and click to. If after about a minute, you move the mouse over the object, you will get the error: A callback was made on a garbage collected delegate of type 'UnigineSharp_double_x64!Unigine.Widget+Callback0::Invoke'. This may cause application crashes, corruption and data loss. When passing delegates to unmanaged code, they must be kept alive by the managed application until it is guaranteed that they will never be called. As we are keeping copies of all of the objects, we should be keeping the objects alive and prevent them from being garbage collected. Is there something obvious we're doing wrong, or is there a recommended way of handling UI's within C#. Thanks, Robert
- 12 replies
-
Hello. I have two ObjectGui on the scene. Both of them have WidgetSprite with callbacks: GUI_ENTER, GUI_LEAVE, GUI_PRESSED and GUI_RELEASED. So the problem: callbacks are firing when they should not. Sometimes when i click on one sprite, i see click on both sprites. Sometimes i just click somewhere in the world and one of sprites become clicked too. It is clearly seen in attached simple demo. I expect sprites to work like independent buttons with 3 states (normal, mouse over, pressed). sprite_callbacks.rar
- 1 reply
-
- WidgetSprite
- ObjectGui
-
(and 2 more)
Tagged with: