create statusicon only when needed

This commit is contained in:
Yann Leboulanger 2007-01-31 16:38:04 +00:00
parent 5fc442b6f5
commit b45b27697a
1 changed files with 6 additions and 3 deletions

View File

@ -28,11 +28,14 @@ class StatusIcon(systray.Systray):
# and can't do cool tooltips we use
def __init__(self):
systray.Systray.__init__(self)
self.status_icon = gtk.StatusIcon()
self.status_icon = None
def show_icon(self):
self.status_icon.connect('activate', self.on_status_icon_left_clicked)
self.status_icon.connect('popup-menu', self.on_status_icon_right_clicked)
if not self.status_icon:
self.status_icon - gtk.StatusIcon()
self.status_icon.connect('activate', self.on_status_icon_left_clicked)
self.status_icon.connect('popup-menu',
self.on_status_icon_right_clicked)
self.set_img()
self.status_icon.props.visible = True