Permalink
Browse files

[gi-demos] fix up search-entry to reflect annotations fixed in Gtk+ m…

…aster
  • Loading branch information...
1 parent cd046e4 commit ee2b63f60f350332ed21927721ed9ddff3a8034e John (J5) Palmieri committed Mar 3, 2011
Showing with 9 additions and 14 deletions.
  1. +9 −14 demos/gtk-demo/demos/Entry/search_entry.py
@@ -89,22 +89,19 @@ def __init__(self, demoapp):
# Create the menu
menu = self.create_search_menu(entry)
entry.connect('icon-press', self.icon_press_cb, menu)
- # FIXME:
- # menu.attach_to_widget(entry, None) - missing annotation prevents
- # using this method so do manually for now
- entry.connect('button-press-event', self.popup_menu, menu)
- # add accessible alternatives for icon functionality */
+ # FIXME: this should take None for the detach callback
+ # but our callback implementation does not allow
+ # it yet, so we pass in a noop callback
+ menu.attach_to_widget(entry, self.detach)
+
+ # add accessible alternatives for icon functionality
entry.connect('populate-popup', self.entry_populate_popup)
self.window.show_all()
- def popup_menu(self, entry, event, menu):
- if event.button != 3:
- return False
-
- menu.popup(None, None, None, None,
- event.button, event.time)
+ def detach(self, *args):
+ pass
def show_find_button(self):
self.notebook.set_current_page(0)
@@ -204,11 +201,9 @@ def create_search_menu(self, entry):
def icon_press_cb(self, entry, position, event, menu):
- # FIXME: sending in a GdkEvent when it should send in GdkEventButton
- # requires a Gtk annotation
if position == Gtk.EntryIconPosition.PRIMARY:
menu.popup(None, None, None, None,
- event.button.button, event.button.time)
+ event.button, event.time)
else:
self.clear_entry(entry)

0 comments on commit ee2b63f

Please sign in to comment.