Fix add_toolbutton() to work with non-stock images.

This commit is contained in:
Andrew Resch 2008-03-07 00:55:46 +00:00
parent 882a7e8033
commit ff4009cb6e
1 changed files with 4 additions and 2 deletions

View File

@ -87,7 +87,9 @@ class ToolBar(component.Component):
tooltip=None):
"""Adds a toolbutton to the toolbar"""
# Create the button
toolbutton = gtk.ToolButton(stock)
toolbutton = gtk.ToolButton()
if stock is not None:
toolbutton.set_stock_id(stock)
if label is not None:
toolbutton.set_label(label)
if image is not None:
@ -104,7 +106,7 @@ class ToolBar(component.Component):
self.toolbar.insert(toolbutton, -1)
# Show the new toolbutton
toolbutton.show()
toolbutton.show_all()
return toolbutton