[pygtk] Setting application name in pygtk?
Willie Walker
William.Walker at Sun.COM
Wed Nov 8 00:08:48 WST 2006
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?
In particular, we want to be able to set the app name for ATK so that
assistive technology clients will get a more human consumable string.
It looks like we might be able to do this *before* the import of gtk:
import sys
sys.argv[0] = "Orca"
I tried this and it seems to work, but I feel a little strange about it.
What crimes against humanity am I committing by doing this?
Will
On Tue, 2006-11-07 at 07:02 -0800, Brian wrote:
> On Mon, 2006-06-11 at 15:21 -0800, Lynn Monsanto wrote:
> > Hi all,
> >
> > I'm a developer working on the Orca screen reader:
> > http://live.gnome.org/Orca. We are currently starting Orca using a bash
> > script (see below). This works okay, but has one problem. The AT-SPI
> > returns the application name as "-c". Is there a way to explicitly set
> > an application name in pygtk when starting an application using the "-c"
> > flag?
> >
> > Thanks and best regards!
> > Lynn Monsanto
> >
> > # Runs orca.
> > #
> > runOrca()
> > {
> > exec_prefix=@prefix@
> > PYTHONPATH=@pyexecdir@
> > export PYTHONPATH
> > @PYTHON@ -c "import orca.orca; orca.orca.main()" "$ARGS"
> > }
> >
>
> In your app just before you show your window.
>
> window.set_title('My Title')
>
> Actually you can change the title at any time. In our specialized
> terminal app. we change the title to the status bar text when the window
> is minimized. That allows the taskbar to show the status of what is
> running.
>
More information about the pygtk
mailing list