X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..2da6105611475cb08135997c587df72be67840bd:/wxPython/demo/FontEnumerator.py diff --git a/wxPython/demo/FontEnumerator.py b/wxPython/demo/FontEnumerator.py index 79421a2a2f..5ada2dac5c 100644 --- a/wxPython/demo/FontEnumerator.py +++ b/wxPython/demo/FontEnumerator.py @@ -28,12 +28,22 @@ class TestPanel(wxPanel): list.sort() - wxStaticText(self, -1, "Face names:", wxPoint(15, 50), wxSize(65, 18)) - self.lb1 = wxListBox(self, 60, wxPoint(80, 50), wxSize(200, 250), + wxStaticText(self, -1, "Face names:", (15, 50), (65, 18)) + self.lb1 = wxListBox(self, -1, (80, 50), (200, 250), list, wxLB_SINGLE) + EVT_LISTBOX(self, self.lb1.GetId(), self.OnSelect) + + self.txt = wxStaticText(self, -1, "Sample text...", (285, 50)) + self.lb1.SetSelection(0) + def OnSelect(self, evt): + face = self.lb1.GetStringSelection() + font = wxFont(28, wxDEFAULT, wxNORMAL, wxNORMAL, false, face) + self.txt.SetFont(font) + self.txt.SetSize(self.txt.GetBestSize()) + #----------------------------------------------------------------------