]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/wxStaticText.py
fixed wxWindow::SetCursor( wxNullCursor) for mac
[wxWidgets.git] / wxPython / demo / wxStaticText.py
CommitLineData
cf694132
RD
1
2from wxPython.wx import *
3
4#---------------------------------------------------------------------------
5
6class TestPanel(wxPanel):
7 def __init__(self, parent):
8 wxPanel.__init__(self, parent, -1)
9
10 wxStaticText(self, -1, "This is an example of static text",
11 wxPoint(20, 10))
12
13 wxStaticText(self, -1, "using the wxStaticText Control.",
14 wxPoint(20, 30))
15
16 wxStaticText(self, -1, "Is this yellow?",
17 wxPoint(20, 70)).SetBackgroundColour(wxNamedColour('Yellow'))
18
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)
23 text.SetFont(font)
24 text.SetSize(wxSize(w, h))
25
26
27#---------------------------------------------------------------------------
28
29def runTest(frame, nb, log):
30 panel = TestPanel(nb)
31 return panel
32
33
34#---------------------------------------------------------------------------
35
36
37
38
39
40
41
42
43overview = '''\
44A static text control displays one or more lines of read-only text.
45
46wxStaticText()
47-------------------------
48
49Default constructor.
50
51wxStaticText(wxWindow* parent, wxWindowID id, const wxString& label = "", const wxPoint& pos, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = "staticText")
52
53Constructor, creating and showing a text control.
54
55Parameters
56-------------------
57
58parent = Parent window. Should not be NULL.
59
60id = Control identifier. A value of -1 denotes a default value.
61
62label = Text label.
63
64pos = Window position.
65
66size = Window size.
67
68style = Window style. See wxStaticText.
69
70name = Window name.
71'''
72
73#---------------------------------------------------------------------------