set gnome app name

Hi,

is there any way how to change app name shown in gnome taskbar (see
attachment) from wxPython code? I tried app.setAppName(), but it
didn't worked.

Thanks in advanced, Martin

gnome-app-name.png

···

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa

Perhaps try the other wx.App name functions?
wx.App.SetAppDisplayName

wx.App.SetVendorDisplayName

wx.App.SetVendorName

Hi,

···

2016-02-06 0:26 GMT+01:00 DevPlayer <devplayer@gmail.com>:

Perhaps try the other wx.App name functions?
wx.App.SetAppDisplayName
wx.App.SetVendorDisplayName
wx.App.SetVendorName

thanks for tip, I tried to call these functions in my App constructor,
but none of them has any effect. The application name in gnome taskbar
is still set to file name (wxgui.py).

Martin

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa

By “Constructor” I hope you mean

def OnInit(self):
    self.SetAppName('MyApp')
    return True:

``

and not:

def __init__(self, ...):

``

I am not sure if it matters but that is where I would call those from.

Hi,

By "Constructor" I hope you mean

I meant __init__().

    def OnInit(self):
        self.SetAppName('MyApp')
        return True:

I tried to add to OnInit():

        self.SetAppName('MyApp')
        self.SetAppDisplayName('1')
        self.SetVendorDisplayName('2')
        self.SetVendorName('3')

But none of them had any effect. I still see in taskbar 'Wxgui.py'. Martin

···

2016-02-06 19:52 GMT+01:00 DevPlayer <devplayer@gmail.com>:

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa

Are you possibly launching this from a pyshell or a possible other wxPython app where wx.App() may already be initialized?
You can try

if name == “main”:

app = wx.GetApp()

if not app:

app = wx.App()

else:

print(‘app pre-existed’)

as a short test. Although even this shouldn’t matter.

Hi,

Are you possibly launching this from a pyshell or a possible other wxPython
app where wx.App() may already be initialized?

no from C code [1].

    app = wx.GetApp()

GetApp() returns None, there is no other wx.App initialized. Martin

[1] main.c in grass/trunk/general/g.gui – GRASS GIS

···

2016-02-06 20:44 GMT+01:00 DevPlayer <devplayer@gmail.com>:

--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa

In your first post the image shows Wxgui.py in the taskbar one implying no C code and two implying your doing something like “>python Wxgui.py”. Are you running the source code from an Icon or “shortcut” or from a command line? If from a gnome command line(?) what is the exact command line syntax? Is your main source code file named Wxgui.py? If so you can wrap your python script within a non-python script file marked with executable permissions. That hack might trick it.

And then there is this:

http://askubuntu.com/questions/101734/how-can-i-show-the-application-name-in-the-panel

Hi,

In your first post the image shows Wxgui.py in the taskbar one implying no C

the C code just launches 'python wxgui.py', no other magic :slight_smile:

code and two implying your doing something like ">python Wxgui.py". Are you

Right.

running the source code from an Icon or "shortcut" or from a command line?
If from a gnome command line(?) what is the exact command line syntax? Is
your main source code file named Wxgui.py? If so you can wrap your python

The main python file which is launched from command line (aka `python
/path/to/wxgui.py`) is wxgui.py.

script within a non-python script file marked with executable permissions.
That hack might trick it.

hm, if I understand correctly you are suggesting to create wrapper
with the same name as I want for application? So eg. the 'GRASS GIS
(GUI)' if I want application with name 'GRASS GIS (GUI)'. Really,
isn't there any better way?

And then there is this:
11.10 - How can I show the application name in the panel? - Ask Ubuntu

I will take a look, thanks. Ma

···

2016-02-06 21:20 GMT+01:00 DevPlayer <devplayer@gmail.com>:

--
http://geo.fsv.cvut.cz/gwiki/Landa

Any progress?

If you didn't understand my last suggestion... In MS-Windows you can have
the following files in the same subdirectory: wxgui.py wxgui.bat wxgui.exe
wxgui.com wxgui.cmd... So in MS-Windows you'd make a wxgui.bat and put in
it the command line you'd type. Double clicking a batch file from Windows
explorer creates a console window (usually) with it's title and taskbar
item. In your operating system is there a textual "script" file which is
executable/runnable and is not a *.py file and creates "console" or
separate terminal "window"?