p.g.lmr : module documentation
Part of planes.gui
lmr - planes.gui widgets with left-mid-right backgrounds.
Copyright 2012, 2013 by Florian Berger <fberger@florian-berger.de>
Module doctests:
>>> display = planes.Display((300, 300))
>>> display.image.fill((128, 128, 128))
<rect(0, 0, 300, 300)>
>>> def exit(plane):
... pygame.quit()
... raise SystemExit
>>> button_1 = LMRButton("Default", 100, exit)
>>> button_1.rect.center = (150, 30)
>>> display.sub(button_1)
>>> button_2 = LMRButton("BLACK", 100, exit, BLACK_BUTTON_STYLE)
>>> button_2.rect.center = (150, 70)
>>> display.sub(button_2)
>>> button_3 = LMRButton("WHITE", 100, exit, WHITE_BUTTON_STYLE)
>>> button_3.rect.center = (150, 110)
>>> display.sub(button_3)
>>> button_4 = LMRButton("ORANGE", 100, exit, ORANGE_BUTTON_STYLE)
>>> button_4.rect.center = (150, 150)
>>> display.sub(button_4)
>>> option_list = LMROptionList("option_list",
... ["Option 1", "Option 2", "Option 3"],
... 250)
>>> option_list.rect.center = (150, 230)
>>> display.sub(option_list)
>>> clock = pygame.time.Clock()
>>> while True:
... events = pygame.event.get()
... display.process(events)
... display.update()
... display.render()
... pygame.display.flip()
... clock.tick(30)
Traceback (most recent call last):
...
SystemExit
Class |
LMRStyle |
This class encapsulates the left, mid and right images to be used as widget background, as well as the text color. |
Class |
LMRWidget |
Base class for fixed-height, flexible-width widgets with an LMR background. |
Class |
LMRButton |
A planes.gui.Button with LMR background. |
Class |
LMROption |
A planes.gui.Option with LMR background. |
Class |
LMROptionList |
A planes.gui.OptionList with LMROption elements. |
Class |
LMRPlusMinusBox |
A planes.gui.PlusMinusBox with LMRButtons. The value is accessible as PlusMinusBox.textbox.text |
API Documentation for planes, generated by pydoctor at 2013-03-05 14:16:20.