]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/samples/wxPIA_book/Chapter-07/static_text.py
3 class StaticTextFrame(wx
.Frame
):
5 wx
.Frame
.__init
__(self
, None, -1, 'Static Text Example',
7 panel
= wx
.Panel(self
, -1)
8 wx
.StaticText(panel
, -1, "This is an example of static text",
10 rev
= wx
.StaticText(panel
, -1, "Static Text With Reversed Colors",
12 rev
.SetForegroundColour('white')
13 rev
.SetBackgroundColour('black')
14 center
= wx
.StaticText(panel
, -1, "align center", (100, 50),
15 (160, -1), wx
.ALIGN_CENTER
)
16 center
.SetForegroundColour('white')
17 center
.SetBackgroundColour('black')
18 right
= wx
.StaticText(panel
, -1, "align right", (100, 70),
19 (160, -1), wx
.ALIGN_RIGHT
)
20 right
.SetForegroundColour('white')
21 right
.SetBackgroundColour('black')
22 str = "You can also change the font."
23 text
= wx
.StaticText(panel
, -1, str, (20, 100))
24 font
= wx
.Font(18, wx
.DECORATIVE
, wx
.ITALIC
, wx
.NORMAL
)
26 wx
.StaticText(panel
, -1, "Your text\ncan be split\n"
27 "over multiple lines\n\neven blank ones", (20,150))
28 wx
.StaticText(panel
, -1, "Multi-line text\ncan also\n"
29 "be right aligned\n\neven with a blank", (220,150),
33 if __name__
== '__main__':
34 app
= wx
.PySimpleApp()
35 frame
= StaticTextFrame()