]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxStaticText.py
2 from wxPython
.wx
import *
4 #---------------------------------------------------------------------------
6 class TestPanel(wxPanel
):
7 def __init__(self
, parent
):
8 wxPanel
.__init
__(self
, parent
, -1)
10 wxStaticText(self
, -1, "This is an example of static text",
13 wxStaticText(self
, -1, "using the wxStaticText Control.",
16 wxStaticText(self
, -1, "Is this yellow?",
17 wxPoint(20, 70)).SetBackgroundColour(wxNamedColour('Yellow'))
19 str = "This is a different font."
20 text
= wxStaticText(self
, -1, str, wxPoint(20, 100))
21 font
= wxFont(20, wxSWISS
, wxNORMAL
, wxNORMAL
, false
, "Arial")
22 w
, h
, d
, e
= self
.GetFullTextExtent(str, font
)
24 text
.SetSize(wxSize(w
, h
))
27 #---------------------------------------------------------------------------
29 def runTest(frame
, nb
, log
):
34 #---------------------------------------------------------------------------
44 A static text control displays one or more lines of read-only text.
47 -------------------------
51 wxStaticText(wxWindow* parent, wxWindowID id, const wxString& label = "", const wxPoint& pos, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = "staticText")
53 Constructor, creating and showing a text control.
58 parent = Parent window. Should not be NULL.
60 id = Control identifier. A value of -1 denotes a default value.
64 pos = Window position.
68 style = Window style. See wxStaticText.
73 #---------------------------------------------------------------------------