[pygtk] Controlling application name in window title bar

John Stowers john.stowers.lists at gmail.com
Tue Mar 4 20:32:48 WST 2008


On Tue, 2008-03-04 at 18:37 +1100, Edward Stow wrote:
> Hi
> 
> I was seeking to control the application name in the window title bar
> away from the default applied by gtk - that is the name of the main
> module.
> Using  something like:
> 
> window.set_title("My Applcation")  only results in this name being
> appended to the main module filename:
> 
> EG  'myapp.py - My Application"   I could rename the module but this
> would not suit.
> 
> The only way I know is to use the following prior to importing gtk:
> 
> import sys
> sys.argv[0]= "My Application"
> 
> This feels like a hack to me -- but is it the only practical method.

Perhaps gobject.set_prgname() and/or gobject.set_application_name()

I cant find them in the docs, but you can refer to the documentation for
glib I guess

http://library.gnome.org/devel/glib/2.15/glib-Miscellaneous-Utility-Functions.html#g-set-prgname

> 
> (Using Ubuntu and Nokia Maemo )
> 
> 



More information about the pygtk mailing list