From: Murat Erten <murerten@gmail.com>
<snip>
def OnChooseFont(self, event):
dialog = wx.FontDialog(None, wx.FontData())
if dialog.ShowModal() == wx.ID_OK:
data = dialog.GetFontData()
font = data.GetChosenFont()
font_name = font.GetFaceName()
size = font.GetPointSize()
color = data.GetColour()
print "chosen font: %s, %d, %s" % (font_name, size, color)self.frame.text.SetFont(font)
# causes text to be centered in frame, but frame too small
self.frame.sizer.Layout()# These attempts don't get the Frame to accomodate new text size
self.frame.SetMinSize((150, 100)) ### added
self.frame.panel.Fit() ### do this before
self.frame.Fit() ### this
self.frame.SetMinSize(self.frame.GetSize()) ### added
# self.frame.SetSize(self.frame.sizer.GetSize())
I guess I was actually closer than I realized (but not quite there).
And here is a helpful link:
http://wiki.wxpython.org/index.cgi/WindowSizeInfo
Thank you for your reply and link, Murat.
-ej
···
-----Original Message-----