From 56a2ef66ee3e2344086648d0c06c8bbb8cb10cf7 Mon Sep 17 00:00:00 2001 From: Agustin Zubiaga Date: Thu, 10 May 2012 02:30:00 +0000 Subject: Show alert button palette immediate --- diff --git a/illustrate.py b/illustrate.py index c8fe839..4d24b91 100644 --- a/illustrate.py +++ b/illustrate.py @@ -89,7 +89,7 @@ class IllustrateActivity(activity.Activity): alert_btn = ToolButton("alert-icon") alert_btn.set_tooltip(_("Alert example")) - alert_btn.connect("clicked", self._show_example_alert) + alert_btn.connect("clicked", self._show_alert_btn_pallete) toolbarbox.toolbar.insert(alert_btn, -1) options_button = ToolbarButton(icon_name='preferences-system') @@ -143,6 +143,9 @@ class IllustrateActivity(activity.Activity): self._create_canvas(canvas) self._create_alert_btn_palette(alert_btn) + def _show_alert_btn_pallete(self, widget): + widget.props.palette.popup(immediate=True, state=1) + def _create_alert_btn_palette(self, button): palette = button.get_palette() hbox = gtk.HBox() @@ -154,7 +157,7 @@ class IllustrateActivity(activity.Activity): notify.connect("clicked", self._show_example_alert, True) hbox.pack_start(simple, False, True, 0) - hbox.pack_start(notify, False, True, 0) + hbox.pack_end(notify, False, True, 0) hbox.show_all() -- cgit v0.9.1