I am trying to fix up the fonts which are quite ugly by default right now on my Debian-unstable (sid) box, which has wxgtk, and wxgtk-python installed on it, from 'unstable'. my gnome/gtk stuff is all 2.x, but the fonts in wxPython still look like somebody beat them with the ugly stick, and it doesn't seem to pick up the configuration of fonts that I specified in gnome-control-center, also, interestingly, I get this output, when I run the simple.py (or anything else) using wxPython, these errors appear on the console...
The font "-cronyx-helvetica-medium-r-normal-*-17-*-*-*-p-*-koi8-r" does not support all the required character sets for the current locale "C"
(Missing character set "ISO8859-1")
(It repeats this error 3 times, then the wx gui appears.)
Where is it picking the fonts configuration from, and how can I get them to look nicer? Interestingly gtk-config --version reports 1.2.10, whereas gnome-control-center is 2.2.2. Methinks, I might be mistook here, but is wxPython on Linux essentially stuck with gnome 1.x era capabilities? Can I get nice fonts? How?
Ok, now tested. Watch the frame title as you click the button:
···
--- Donnal Walter <donnalcwalter@yahoo.com> wrote:
--- Greg Binns <gregbin@bigpond.net.au> wrote:
>
> Hi
> How do I reference the instance of the main frame that is
> created when the app starts?
> Regards,
> Greg
>
Try this (untested):
myapp = wx.GetApp()
mf = myapp.GetTopWindow()
==================================================================
#!/usr/bin/env python
from wxPython.wx import *
class MyFrame(wxFrame):
def __init__(self):
wxFrame.__init__(self, None, -1,
'Frame title BEFORE button click',
size=(300, 200))
abutton = wxButton(parent=self, id=-1,
label= 'Click to change title')
EVT_BUTTON(self, abutton.GetId(), self.OnClick)
def OnClick(self, event):
myapp = wxGetApp() # get application
tf = myapp.GetTopWindow() # get top frame
tf.SetTitle('Top frame title changed') # change its title
class MyApp(wxApp):
def OnInit(self):
frame = MyFrame()
frame.Show(1)
return 1