2
# THIS FILE IS PART OF THE JOKOSHER PROJECT AND LICENSED UNDER THE GPL. SEE
3
# THE 'COPYING' FILE FOR DETAILS
7
# This module is a better status bar than the one included
8
# with gtk because it allows pango markup (bold, etc.).
10
#-------------------------------------------------------------------------------
14
#=========================================================================
16
class StatusBar(gtk.Statusbar):
18
Implements an improved status bar which allows pango markup styles (bold, italics, etc).
20
#_____________________________________________________________________
24
Creates a new instance of StatusBar with no messages shown.
26
gtk.Statusbar.__init__(self)
27
# gtk.Statusbar contains a label inside a frame inside itself
28
self.label = self.get_children()[0].get_children()[0]
29
self.label.set_use_markup(True)
31
#_____________________________________________________________________
33
def Push(self, message):
35
Insert a new message into the messages stack.
38
message -- string containing the new message to be added to the StatusBar.
41
the value of the next valid message ID.
43
message_id = self.push(0, message)
44
self.label.set_use_markup(True)
47
#_____________________________________________________________________
49
def Remove(self, message_id):
51
Removes a new message from the messages stack.
54
message_id -- numerical id of the message to be removed from the StatusBar.
56
self.remove(0, message_id)
57
self.label.set_use_markup(True)
59
#_____________________________________________________________________
61
#=========================================================================