Exemple #1
0
    frm_center.children = align_left, align_center, align_right

    # Bottom alignments.
    align_bottomleft = Alignment (100, 50)
    align_bottomleft.align = ALIGN_BOTTOM | ALIGN_LEFT
    align_bottomleft.child = Button ("bottomleft")

    align_bottom = Alignment (100, 50)
    align_bottom.align = ALIGN_BOTTOM
    align_bottom.child = Button ("bottom")

    align_bottomright = Alignment (100, 50)
    align_bottomright.align = ALIGN_BOTTOM | ALIGN_RIGHT
    align_bottomright.child = Button ("bottomright")

    frm_bottom = HFrame ()
    frm_bottom.children = align_bottomleft, align_bottom, align_bottomright

    frm_main.children = frm_top, frm_center, frm_bottom
    return frm_main

if __name__ == "__main__":
    # Initialize the drawing window.
    re = Renderer ()
    re.create_screen (350, 300)
    re.title = "Alignment examples"
    re.color = (234, 228, 223)
    re.add_widget (create_alignment_view ())
    # Start the main rendering loop.
    re.start ()
Exemple #2
0
# Renderer examples.
from ocempgui.widgets import Renderer

# Initialize the drawing window.
re = Renderer ()
screen = re.create_screen (200, 200)
re.title = "Renderer"
re.color = (250, 250, 250)

# Start the main rendering loop.
re.start ()