def get_widgets(self): toolbar = gtk.Toolbar() items = {} for data in toolbar_data: label, stock_id, callback, sub_callback = data cb = make_callback(self.window, callback, sub_callback) icon = gtk.Image() icon.set_from_stock(stock_id, gtk.ICON_SIZE_BUTTON) items[callback] = toolbar.append_item(label, label, None, icon, cb) toolbar.append_space() filter_box, entry = self.get_filter_box() toolbar.append_widget(filter_box, "Partition name filter", None) return toolbar, items, entry
def get_widgets(self): toolbar = gtk.Toolbar() items = {} for data in toolbar_data: label, stock_id, callback, sub_callback = data cb = make_callback(self.window, callback, sub_callback) icon = gtk.Image() icon.set_from_stock(stock_id, gtk.ICON_SIZE_BUTTON) items[callback] = toolbar.append_item(label, label, None, icon, cb) toolbar.append_space() filter_box, entry = self.get_filter_box() toolbar.append_widget(filter_box, 'Partition name filter', None) return toolbar, items, entry
def __init__(self, window): self.window = window self.items = [] for data in menu_data: item = list(data) data_list = [None] * 6 data_list[0:len(data)] = data path, accel, callback, sub_callback, item_type, extra = data_list if self.is_special(item_type): del item[4:] if callback: if sub_callback: del item[3:] item[2] = make_callback(window, callback, sub_callback) self.items.append(tuple(item))