]>
Commit | Line | Data |
---|---|---|
cf694132 RD |
1 | |
2 | from wxPython.wx import * | |
3 | ||
4 | #--------------------------------------------------------------------------- | |
5 | ||
6 | def 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 | |
11 | print data.GetColour() | |
0c3d4bfd | 12 | dlg = wxFontDialog(frame, data) |
cf694132 RD |
13 | if dlg.ShowModal() == wxID_OK: |
14 | data = dlg.GetFontData() | |
15 | font = data.GetChosenFont() | |
16 | log.WriteText('You selected: "%s", %d points, color %s\n' % | |
17 | (font.GetFaceName(), font.GetPointSize(), | |
18 | data.GetColour().Get())) | |
19 | dlg.Destroy() | |
20 | ||
21 | #--------------------------------------------------------------------------- | |
22 | ||
23 | ||
24 | ||
25 | ||
26 | ||
27 | ||
28 | ||
29 | ||
30 | ||
31 | ||
32 | ||
33 | ||
34 | ||
35 | overview = """\ | |
36 | This class represents the font chooser dialog. | |
37 | ||
38 | wxFontDialog() | |
39 | ---------------------------- | |
40 | ||
0c3d4bfd | 41 | wxFontDialog(wxWindow* parent, wxFontData* data) |
cf694132 | 42 | |
0c3d4bfd | 43 | Constructor. Pass a parent window and a font data object, which will be copied to the font dialog's font data. |
cf694132 | 44 | """ |