File: label_test.py

package info (click to toggle)
python-enable 4.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 7,280 kB
  • ctags: 13,899
  • sloc: cpp: 48,447; python: 28,502; ansic: 9,004; makefile: 315; sh: 44
file content (20 lines) | stat: -rw-r--r-- 558 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
""" Small demo of the Label component.  """

from enable.example_support import DemoFrame, demo_main
from enable.label import Label

from enable.api import Window


class MyFrame(DemoFrame):

    def _create_window(self):
        label = Label(bounds=[100, 50], position=[50,50], text="HELLO")
        label.bgcolor = "lightpink"
        return Window(self, -1, component=label)


if __name__ == "__main__":
    # Save demo so that it doesn't get garbage collected when run within
    # existing event loop (i.e. from ipython).
    demo = demo_main(MyFrame)