示例#1
0
    def pointer(self):
        """
        Returns this control as ui pointer.

        :return: uiControl ctype pointer
        """
        return libui.uiControlPointer(self.control)
示例#2
0
def onClosing(window, data):
    print('On closing..')
    control = libui.uiControlPointer(window)
    libui.uiControlDestroy(control)
    libui.uiQuit()
    return 0
示例#3
0

# Initialize libui
options = libui.uiInitOptions()
libui.uiInit(options)

# Window
window = libui.uiNewWindow('Window', 640, 480, 1)
libui.uiWindowSetMargined(window, 1)

# 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)

# Show window
control = libui.uiControlPointer(window)
libui.uiControlShow(control)

# Main loop
libui.uiMain()

# Destroy
libui.uiUninit()
示例#4
0
def onClosing(window, data):
    print('On closing..')
    control = libui.uiControlPointer(window)
    libui.uiControlDestroy(control)
    libui.uiQuit()
    return 0
示例#5
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()
示例#6
0
# Initialize libui
options = libui.uiInitOptions()
libui.uiInit(options)

# Window
window = libui.uiNewWindow('Window', 640, 480, 1)
libui.uiWindowSetMargined(window, 1)


# 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)

# Show window
control = libui.uiControlPointer(window)
libui.uiControlShow(control)

# Main loop
libui.uiMain()

# Destroy
libui.uiUninit()
示例#7
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()