]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxStaticText.py
1 # 11/21/2003 - Jeff Grimmett (grimmtooth@softhome.net)
3 # o Updated for wx namespace
4 # o Removed the USE_GENERIC code because it doesn't work unless you use
5 # the 'from wx import *' methodology.
10 #---------------------------------------------------------------------------
12 class TestPanel(wx
.Panel
):
13 def __init__(self
, parent
):
14 wx
.Panel
.__init
__(self
, parent
, -1)
16 wx
.StaticText(self
, -1, "This is an example of static text", (20, 10))
17 wx
.StaticText(self
, -1, "using the wxStaticText Control.", (20, 30))
20 self
, -1, "Is this yellow?", (20, 70), (90, -1)
21 ).SetBackgroundColour('Yellow')
24 self
, -1, "align center", (120, 70), (90, -1), wx
.ALIGN_CENTER
25 ).SetBackgroundColour('Yellow')
28 self
, -1, "align right", (220, 70), (90, -1), wx
.ALIGN_RIGHT
29 ).SetBackgroundColour('Yellow')
31 str = "This is a different font."
32 text
= wx
.StaticText(self
, -1, str, (20, 100))
33 font
= wx
.Font(18, wx
.SWISS
, wx
.NORMAL
, wx
.NORMAL
)
35 #text.SetSize(text.GetBestSize())
37 wx
.StaticText(self
, -1, "Multi-line wxStaticText\nline 2\nline 3\n\nafter empty line", (20,150))
38 wx
.StaticText(self
, -1, "Align right multi-line\nline 2\nline 3\n\nafter empty line", (220,150), style
=wx
.ALIGN_RIGHT
)
41 #---------------------------------------------------------------------------
43 def runTest(frame
, nb
, log
):
48 #---------------------------------------------------------------------------
52 A static text control displays one or more lines of read-only text.
57 if __name__
== '__main__':
60 run
.main(['', os
.path
.basename(sys
.argv
[0])])