X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6bff4be599aefb32d69734849e4c8fc1529f7868..6a6ff5640dc0c7c4153f494d311d7ab1d8b33947:/wxPython/demo/FontEnumerator.py?ds=sidebyside diff --git a/wxPython/demo/FontEnumerator.py b/wxPython/demo/FontEnumerator.py index bbad99dffb..27a1466d94 100644 --- a/wxPython/demo/FontEnumerator.py +++ b/wxPython/demo/FontEnumerator.py @@ -28,12 +28,26 @@ 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()) + +## st = font.GetNativeFontInfo().ToString() +## ni2 = wxNativeFontInfo() +## ni2.FromString(st) +## font2 = wxFontFromNativeInfo(ni2) #---------------------------------------------------------------------- @@ -50,11 +64,14 @@ def runTest(frame, nb, log): - - - - overview = """\ wxFontEnumerator enumerates either all available fonts on the system or only the ones with given attributes - either only fixed-width (suited for use in programs such as terminal emulators and the like) or the fonts available in the given encoding. """ + + +if __name__ == '__main__': + import sys,os + import run + run.main(['', os.path.basename(sys.argv[0])]) +