]> git.saurik.com Git - wxWidgets.git/blame - wxPython/demo/wxFontDialog.py
simpler fix for rendering bug fixed in previous revision
[wxWidgets.git] / wxPython / demo / wxFontDialog.py
CommitLineData
cf694132
RD
1
2from wxPython.wx import *
3
4#---------------------------------------------------------------------------
5
6def runTest(frame, nb, log):
0c3d4bfd 7 data = wxFontData()
68320e40
RD
8 data.EnableEffects(true)
9 font_colour = wxColour(255, 0, 0) # colour of font (red)
10 data.SetColour(font_colour) # set colour
eb0f373c 11 ##print data.GetColour()
0c3d4bfd 12 dlg = wxFontDialog(frame, data)
eb0f373c 13 dlg.SetSize((250,250))
cf694132
RD
14 if dlg.ShowModal() == wxID_OK:
15 data = dlg.GetFontData()
16 font = data.GetChosenFont()
17 log.WriteText('You selected: "%s", %d points, color %s\n' %
18 (font.GetFaceName(), font.GetPointSize(),
19 data.GetColour().Get()))
20 dlg.Destroy()
21
22#---------------------------------------------------------------------------
23
24
25
26
27
28
29
30
31
32
33
34
35
36overview = """\
37This class represents the font chooser dialog.
38
39wxFontDialog()
40----------------------------
41
0c3d4bfd 42wxFontDialog(wxWindow* parent, wxFontData* data)
cf694132 43
0c3d4bfd 44Constructor. Pass a parent window and a font data object, which will be copied to the font dialog's font data.
cf694132 45"""