]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/FontEnumerator.py
checked in forgottern parts of MSLU changes
[wxWidgets.git] / wxPython / demo / FontEnumerator.py
index 79421a2a2f5f7506cf1c85b66ebd4b644316bfd7..5ada2dac5c861d1aecbda48e10bd40250b1da104 100644 (file)
@@ -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())
+
 
 
 #----------------------------------------------------------------------