Exemplo n.º 1
0
 def _init_ui(self):  
     self.model=Gtk.ListStore(str)
     self.view=self.ui.get_widget('actions-view')
     self.view.set_model(self.model)
     self.view.set_reorderable(True)
     all_actions_model = Gtk.ListStore(str)
     for a in actions.get_actions_list(True):
         all_actions_model.append([a])
         
     renderer_combo = Gtk.CellRendererCombo()
     renderer_combo.set_property("editable", True)
     renderer_combo.set_property("model", all_actions_model)
     renderer_combo.set_property("text-column", 0)
     renderer_combo.set_property("has-entry", False)
     renderer_combo.connect("edited", self.on_action_edited)
     
     column=Gtk.TreeViewColumn("Actions", renderer_combo, text=0)
     self.view.append_column(column)
     
     select=self.view.get_selection()
     select.connect("changed", self.on_selection)
Exemplo n.º 2
0
 def get_inital_list(self):
     names = actions.get_actions_list(sorted=True)
     for i, name in enumerate(names):
         yield "%s-%d" % (self.get_path_base(), i), name