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