Moved and reorganized wxPython directories
Now builds into an intermediate wxPython package directory before installing git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7403 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
61
wxPython/demo/FontEnumerator.py
Normal file
61
wxPython/demo/FontEnumerator.py
Normal file
@@ -0,0 +1,61 @@
|
||||
|
||||
from wxPython.wx import *
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
## class MyFontEnumerator(wxFontEnumerator):
|
||||
## def __init__(self, list):
|
||||
## wxFontEnumerator.__init__(self)
|
||||
## self.list = list
|
||||
|
||||
## def OnFacename(self, face):
|
||||
## self.list.append(face)
|
||||
## return true
|
||||
|
||||
|
||||
|
||||
class TestPanel(wxPanel):
|
||||
def __init__(self, parent, log):
|
||||
wxPanel.__init__(self, parent, -1)
|
||||
|
||||
## list = []
|
||||
## e = MyFontEnumerator(list)
|
||||
## e.EnumerateFacenames()
|
||||
|
||||
e = wxFontEnumerator()
|
||||
e.EnumerateFacenames()
|
||||
list = e.GetFacenames()
|
||||
|
||||
list.sort()
|
||||
|
||||
wxStaticText(self, -1, "Face names:", wxPoint(15, 50), wxSize(65, 18))
|
||||
self.lb1 = wxListBox(self, 60, wxPoint(80, 50), wxSize(200, 250),
|
||||
list, wxLB_SINGLE)
|
||||
self.lb1.SetSelection(0)
|
||||
|
||||
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
def runTest(frame, nb, log):
|
||||
win = TestPanel(nb, log)
|
||||
return win
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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.
|
||||
|
||||
"""
|
Reference in New Issue
Block a user