def setChild(self, child): """ Sets a control as child of the window. :param child: control :return: None """ libui.uiWindowSetChild(self.control, child.pointer())
# Create quit handler def onClosing(window, data): print('On closing..') control = libui.uiControlPointer(window) libui.uiControlDestroy(control) libui.uiQuit() return 0 # Keep reference to native C onClosing handler onclose = libui.uiWindowOnClosing(window, onClosing, None) # Create box box = libui.uiNewVerticalBox() libui.uiBoxSetPadded(box, 1) libui.uiWindowSetChild(window, libui.uiControlPointer(box)) # Create label label = libui.uiNewLabel('Hello World') libui.uiBoxAppend(box, libui.uiControlPointer(label), 0) # Show window control = libui.uiControlPointer(window) libui.uiControlShow(control) # Main loop libui.uiMain() # Destroy libui.uiUninit()