On 10/14/2013 03:31 PM, Ivan Ovcherenko wrote:
Hello
I’m issue some troubles with libyui. I’m build up some ui, clear part of it using «deleteChildren()» method of one of my widgets and build another part of ui down from this widget. At first I have good working ui, but after above actions no any ui displayed. I’m check it on openSUSE 12.3 official and custom build libyui 3.0.10 with Qt and NCurses interface plugins - all the same. But with gtk interface plugin in openSUSE 12.3 all works fine. In some rare cases with same technique I got working interface in ncurses but not working Qt.
Hi. Could you please an issue here: https://github.com/libyui/libyui/issues You can use following workaround until the bug is fixed: mainDialog->deleteChildren(); mainDialog->destroy(); mainDialog = YUI::widgetFactory()->createMainDialog(); Cheers, Thomas
There is a sample code:
#include "YUI.h" #include "YWidgetFactory.h" #include "YDialog.h" #include "YLayoutBox.h" #include "YSpacing.h" #include "YLabel.h" #include "YPushButton.h" #include "YEvent.h" #include "YDialogSpy.h"
int main(int argc, char **argv) { /*****************************************************************************************/ auto mainDialog = YUI::widgetFactory()->createMainDialog();
auto mainVBox = YUI::widgetFactory()->createVBox(mainDialog); auto mainLabel = YUI::widgetFactory()->createLabel(mainVBox, "Hello world!"); YUI::widgetFactory()->createVSpacing(mainVBox); auto mainButton = YUI::widgetFactory()->createPushButton(mainVBox, "Close"); mainDialog->pollEvent(); YDialogSpy::showDialogSpy(); while (true) { auto event = mainDialog->waitForEvent(); if (event) if (event->eventType() == YEvent::CancelEvent || event->widget() == mainButton) break; } mainDialog->deleteChildren(); /*****************************************************************************************/ mainVBox = YUI::widgetFactory()->createVBox(mainDialog); mainLabel = YUI::widgetFactory()->createLabel(mainVBox, "Hello world #2!"); YUI::widgetFactory()->createVSpacing(mainVBox); mainButton = YUI::widgetFactory()->createPushButton(mainVBox, "Close #2"); mainDialog->pollEvent(); YDialogSpy::showDialogSpy(); while (true) { auto event = mainDialog->waitForEvent(); if (event) if (event->eventType() == YEvent::CancelEvent || event->widget() == mainButton) break; } mainDialog->destroy(); return 0;
}
-- Thomas Goettlicher SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) Maxfeldstraße 5 90409 Nürnberg Germany -- To unsubscribe, e-mail: libyui-devel+unsubscribe@opensuse.org To contact the owner, e-mail: libyui-devel+owner@opensuse.org