gtk.Statusbar — report messages of minor importance to the user.
class gtk.Statusbar(gtk.HBox): |
+--gobject.GObject +-- gtk.Object +-- gtk.Widget +-- gtk.Container +-- gtk.Box +-- gtk.HBox +-- gtk.Statusbar
|
gtk.Container Signal Prototypes
def callback( | |
def callback( |
A gtk.Statusbar
is
usually placed along the bottom of an application's main gtk.Window
. It may
provide a regular commentary of the application's status (as is usually the
case in a web browser, for example), or may be used to simply output a
message when the status changes, (when an upload is complete in an
FTP
client, for example). It may also have a resize grip
(a triangular area in the lower right corner) which can be clicked on to
resize the window containing the statusbar. Status bars in PyGTK maintain a
stack of messages. The message at the top of the each bar's stack is the one
that will currently be displayed.
Any messages added to a statusbar's stack must specify a
context_id
that is used to uniquely identify the source
of a message. The context_id
can be generated by the
get_context_id
()
method, and associated with a context message. An existing context_id can be
retrieved using the context message using the get_context_id
()
method. Note that messages are stored in a stack, and when choosing which
message to display, the stack structure is adhered to, regardless of the
context identifier of a message.
def get_context_id(context_description
)
| a string identifying the context for the message |
Returns : | an integer context identifier |
The get_context_id
() method returns a
new or existing context identifier, given a description of the actual
context specified by context_description
. In effect,
get_context_id
() both registers and retrieves a
context identifier.
def push(context_id
, text
)
| a context identifier |
| the message text |
Returns : | an integer message identifier |
The push
() method pushes a new message
specified by text
with the specified
context_id
onto a statusbar's stack and returns a
message id that that can be used with the remove_message
()
method.
def pop(context_id
)
| a context identifier |
The pop
() method removes the top
message with the specified context_id
from the
statusbar's stack.
def remove_message(context_id
, message_id
)
| the context identifier |
| the message identifier |
The remove_message
() method removes the message
with the specified message_id
and
context_id
from the statusbar's message stack.
This method is deprecated in PyGTK 2.22 and above
This method calls either
gtk.Container.remove
or gtk.Statusbar.remove_message
depending on parameters. The second option is for compatibility only and will be
eventually removed. New code should use remove
only to remove
widgets (as in gtk.Container
method). To remove messages, use
gtk.Statusbar.remove_message
directly.
def remove_all(context_id
)
| a context identifier. |
This method is available in PyGTK 2.22 and above.
The remove_all
() method forces the removal of all messages
from a statusbar's stack with the exact context_id
.
def set_has_resize_grip(setting
)
| if True a resize grip is
displayed |
The set_has_resize_grip
() method sets
the internal "has_resize_grip" property to the value specified by
setting
. If setting
is
True
a resize grip is displayed on the statusbar
def get_has_resize_grip()
Returns : | True if a resize grip is
displayed |
The get_has_resize_grip
() method
returns the value of the internal "has_resize_grip" property that determines
if a resize grip is displayed on the statusbar.
def get_message_area()
Returns : | a gtk.Box . |
This method is available in PyGTK 2.22 and above.
The get_message_area
() method retrieves
the box containing the label widget.
def callback(statusbar
, context_id
, text
, user_param1
, ...
)
| the statusbar that received the signal |
| the context identifier of the top message |
| the string containing the top message text |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
The "text-popped" signal is emitted when a message is removed from the statusbar message stack. Note the text and context_id are for the top message on the statusbar stack not the message that was actually removed.
def callback(statusbar
, context_id
, text
, user_param1
, ...
)
| the statusbar that received the signal |
| the context identifier of the message added |
| the string containing the message text |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
The "text-pushed" signal is emitted when a message is added to the statusbar message stack.