Properly show the Columns menu.

This commit is contained in:
Andrew Resch 2007-09-27 13:41:19 +00:00
commit 9551aab1c1

View file

@ -164,7 +164,7 @@ class ListView:
def create_checklist_menu(self): def create_checklist_menu(self):
"""Creates a menu used for toggling the display of columns.""" """Creates a menu used for toggling the display of columns."""
self.menu = gtk.Menu() menu = gtk.Menu()
# Iterate through the column_index list to preserve order # Iterate through the column_index list to preserve order
for name in self.column_index: for name in self.column_index:
column = self.columns[name] column = self.columns[name]
@ -180,13 +180,14 @@ class ListView:
# Connect to the 'toggled' event # Connect to the 'toggled' event
menuitem.connect("toggled", self.on_menuitem_toggled) menuitem.connect("toggled", self.on_menuitem_toggled)
# Add the new checkmenuitem to the menu # Add the new checkmenuitem to the menu
self.menu.append(menuitem) menu.append(menuitem)
# Attach this new menu to all the checklist_menus # Attach this new menu to all the checklist_menus
for menu in self.checklist_menus: for _menu in self.checklist_menus:
menu.set_submenu(self.menu) _menu.set_submenu(menu)
_menu.show_all()
return self.menu return menu
def create_new_liststore(self): def create_new_liststore(self):
"""Creates a new GtkListStore based on the liststore_columns list""" """Creates a new GtkListStore based on the liststore_columns list"""