From f9de29f53906b7851fef37f11425649aca323d7d Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Sat, 11 Jul 2009 14:22:05 +0000 Subject: Delete sub-widgets clearly --- (limited to 'examples') diff --git a/examples/toolbar.py b/examples/toolbar.py index e4d24df..36624c0 100644 --- a/examples/toolbar.py +++ b/examples/toolbar.py @@ -9,23 +9,27 @@ window.add(box) toolbar = Toolbar() box.pack_start(toolbar, False) -tollbarbutton_1 = ToolbarButton(toolbar, gtk.Button('1'), +tollbarbutton_1 = ToolbarButton(toolbar, gtk.Button('sub-widget #1'), icon_name='computer-xo', tooltip='foo') toolbar.top.insert(tollbarbutton_1, -1) toolbar.top.insert(gtk.SeparatorToolItem(), -1) -tollbarbutton_2 = ToolbarButton(toolbar, gtk.Button('1'), +tollbarbutton_2 = ToolbarButton(toolbar, gtk.Button('sub-widget #2'), icon_name='button_cancel', tooltip='foo') toolbar.top.insert(tollbarbutton_2, -1) toolbar.top.insert(gtk.SeparatorToolItem(), -1) -tollbarbutton_3 = ToolbarButton(toolbar, gtk.Button('3'), +def del_cb(widget): + toolbar.top.remove(tollbarbutton_3) +del_b = gtk.Button('delete sub-widget #3') +del_b.connect('clicked', del_cb) +tollbarbutton_3 = ToolbarButton(toolbar, del_b, icon_name='activity-journal', - tooltip='foo') + tooltip='del') toolbar.top.insert(tollbarbutton_3, -1) window.show_all() -- cgit v0.9.1