Results 1 to 4 of 4

Thread: how to add a systemtray using python or gambas?

  1. #1
    Join Date
    Oct 2005
    Beans
    5

    how to add a systemtray using python or gambas?

    how to add a systemtray using python or gambas? I want to write a program that will launch a system tray when it start. Can anyone tell me how?
    Thank you very much!

  2. #2
    Join Date
    Apr 2006
    Location
    North of Lake Ontario
    Beans
    168
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: how to add a systemtray using python or gambas?

    in GNOME you may want to look at pygtk. Haven't tried it myself, so can't help you further...
    Registered Linux User #414888

    Skills: Java, Python, LAMP, and eating a hamburger with chopsticks

  3. #3
    Join Date
    Mar 2005
    Location
    Vancouver, Canada
    Beans
    287

    Re: how to add a systemtray using python or gambas?

    Here's a simple example using PyGTK. You'll need to have python-gtk2 and python-gnome2-extras installed.

    Code:
    #! /usr/bin/python
    
    import gtk
    import egg.trayicon     # egg == python-gnome2-extras
    
    def callback(widget, ev):
            print "Button %i pressed!" % ev.button
    
    
    tray = egg.trayicon.TrayIcon("TrayIcon")
    box = gtk.EventBox()
    label = gtk.Label("Click Me!")
    box.add(label)
    tray.add(box)
    tray.show_all()
    
    box.connect("button-press-event", callback)
    
    gtk.main()

  4. #4
    Join Date
    Oct 2005
    Beans
    5

    Re: how to add a systemtray using python or gambas?

    Hi, Thank you!
    It really worked!
    if I want to use some network applet ( such as network interface ) in python, how to realize?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •