Hi,
I'd like to create a custom font dialog where you can select font and font size.
Here is some example code:
#!/usr/bin/python
import wx
class FontDialog(wx.Dialog):
def __init__(self,*args,**kwargs):
super(FontDialog,self).__init__(*args,**kwargs)
self.InitUI()
def InitUI(self):
self.panel = wx.Panel(self)
self.mainSizer = wx.BoxSizer(wx.VERTICAL)
self.SetSize((400,400))
self.subSizer1=wx.BoxSizer(wx.HORIZONTAL)
self.fontList=wx.ListBox(self.panel,size=(100,200))
self.sizeList=wx.ListBox(self.panel,size=(100,200))
self.subSizer1.Add(self.fontList)
self.subSizer1.Add(self.sizeList)
self.mainSizer.Add(self.subSizer1,wx.EXPAND)
self.subSizer2=wx.BoxSizer(wx.HORIZONTAL)
self.okButton=wx.Button(self,wx.ID_OK)
self.cancelButton=wx.Button(self,wx.ID_CANCEL)
self.subSizer2.Add(self.okButton)
self.subSizer2.Add(self.cancelButton)
self.mainSizer.Add(self.subSizer2,wx.BOTTOM)
self.panel.SetSizer(self.mainSizer)
self.Center()
self.Show()
def main():
app = wx.App(False)
FontDialog(None)
app.MainLoop()
if __name__ == "__main__":
main()
Now the problem with that code is, that instead of having the two ListBox next to each other, I only see a small rectangle in the top left of the screen. Whatever I tried, I didn't manage to get it looking right.
Any ideas?
Thank you!