Search code examples
pythongtkgnomepygobject

PyGObject - left-click menu on a status icon


I'm starting to write a small panel applet for Gnome and I'd like the user to be able to left-click on the status icon to see some options and information e.g. similar to sound icon in Gnome 3, where you can set volume via left-click while set preferences via right-click. Right-click code is this:

statusicon.connect("popup-menu", right_button_click)

where right_button_click is the name of the function that gets called on right-click event. The important part is "popup-menu". What would be alternative for setting left-click event?


Solution

  • First thing is to look into the gnome code for the volume control, and that's is this Second, you should look into the API documentation for GtkStatusIcon, and that one is here That should be enough.