示例#1
0
    def setChild(self, child):
        """
        Sets a control as child of the window.

        :param child: control
        :return: None
        """
        libui.uiWindowSetChild(self.control, child.pointer())
示例#2
0
    def setChild(self, child):
        """
        Sets a control as child of the window.

        :param child: control
        :return: None
        """
        libui.uiWindowSetChild(self.control, child.pointer())
示例#3
0
# 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()
示例#4
0
# 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()