[pygtk] Setting application name in pygtk?
Gustavo J. A. M. Carneiro
gjc at inescporto.pt
Sun Nov 12 07:32:25 WST 2006
Sorry for the late reply, but...
On Ter, 2006-11-07 at 11:08 -0500, Willie Walker wrote:
> Hi Brian:
>
> Setting the window title works great for the window, but it doesn't set
> the name of the application. :-( That is, if one were to look at the
> hierarchy with an application like at-poke on GNOME, they'd see
> something like this:
>
> app: "-c"
> window: "my window title here"
> window: "some other window title here"
>
> It's the "-c" that we're trying to make more human consumable. It looks
> like PyGtk is grabbing arg[0] as a default for the application name.
> Other than the prctl stuff at http://davyd.livejournal.com/166352.html,
> is there some other way to tell PyGtk to set the app name?
Actually it might be gnome-python doing that. Since 2.16, when you do
gnome.program_init(...) it looks at sys.argv[0] and calls prctl (or some
BSD equivalent) to change the "process name". This was a hack stolen
from precisely that glob entry.
But I really don't understand why on earth would argv[0] be "-c".
In any case, modifying sys.argv[0] should be pretty safe... unless
done at some arbitrary point during application run time; better do it
only once at startup. Another option is to pass an alternative argv to
gnome.program_init() (4th parameter).
--
Gustavo J. A. M. Carneiro
<gjc at inescporto.pt> <gustavo at users.sourceforge.net>
The universe is always one step beyond logic
More information about the pygtk
mailing list