]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/wxFontDialog.py
2 from wxPython
.wx
import *
4 #---------------------------------------------------------------------------
6 def runTest(frame
, nb
, log
):
8 data
.EnableEffects(true
)
9 font_colour
= wxColour(255, 0, 0) # colour of font (red)
10 data
.SetColour(font_colour
) # set colour
11 ##print data.GetColour()
12 dlg
= wxFontDialog(frame
, data
)
13 dlg
.SetSize((250,250))
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()))
22 #---------------------------------------------------------------------------
37 This class represents the font chooser dialog.
40 ----------------------------
42 wxFontDialog(wxWindow* parent, wxFontData* data)
44 Constructor. Pass a parent window and a font data object, which will be copied to the font dialog's font data.