]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/StaticText.py
7 from wx
.lib
.stattext
import GenStaticText
as StaticText
9 StaticText
= wx
.StaticText
12 #---------------------------------------------------------------------------
14 class TestPanel(wx
.Panel
):
15 def __init__(self
, parent
):
16 wx
.Panel
.__init
__(self
, parent
, -1)
18 StaticText(self
, -1, "This is an example of static text", (20, 10))
19 StaticText(self
, -1, "using the wx.StaticText Control.", (20, 30))
22 self
, -1, "Is this yellow?", (20, 70), (90, -1)
23 ).SetBackgroundColour('Yellow')
26 self
, -1, "align center", (120, 70), (90, -1), wx
.ALIGN_CENTER
27 ).SetBackgroundColour('Yellow')
30 self
, -1, "align right", (220, 70), (90, -1), wx
.ALIGN_RIGHT
31 ).SetBackgroundColour('Yellow')
33 str = "This is a different font."
34 text
= StaticText(self
, -1, str, (20, 100))
35 font
= wx
.Font(18, wx
.SWISS
, wx
.NORMAL
, wx
.NORMAL
)
37 text
.SetSize(text
.GetBestSize())
39 StaticText(self
, -1, "Multi-line wx.StaticText\nline 2\nline 3\n\nafter empty line", (20,150))
40 StaticText(self
, -1, "Align right multi-line\nline 2\nline 3\n\nafter empty line", (220,150), style
=wx
.ALIGN_RIGHT
)
43 #---------------------------------------------------------------------------
45 def runTest(frame
, nb
, log
):
50 #---------------------------------------------------------------------------
54 A StaticText control displays one or more lines of read-only text.
59 if __name__
== '__main__':
62 run
.main(['', os
.path
.basename(sys
.argv
[0])] + sys
.argv
[1:])