Class k.u.l.ListDialog(gtk.Dialog):

Part of kiwi.ui.listdialog

A ListDialog implements a ListContainer in a gtk.Dialog with a close button.

It's a simple Base class which needs to be subclassed to provide interesting functionality.

Example: >>> class MyListDialog(ListDialog): ... ... columns = [Column('name')] ... list_type = ListType.UNEDITABLE ... ... def populate(self): ... return [Settable(name='test')] ... ... def add_item(self): ... return Settable(name="added")
>>> dialog = MyListDialog()
>>> dialog.run()
Function__init__Undocumented
Function_on_listcontainer__add_itemUndocumented
Function_on_listcontainer__remove_itemUndocumented
Function_on_listcontainer__edit_itemUndocumented
Function_on_listcontainer__selection_changedUndocumented
Functionset_list_type
Set list type.
Functionadd_list_item
Add item to list.
Functionadd_list_items
Add items to list.
Functionremove_list_item
Remove item from list.
Functionupdate_list_item
Update item in list.
Functiondefault_removeUndocumented
Functionadd_item
This must be implemented in a subclass if you want to be able
Functionremove_item
A subclass can implement this to get a notification after
Functionedit_item
A subclass must implement this if you want to support editing
Functionselection_changed
This will be called when the selection changes in the ListDialog
Functionpopulate
This will be called once after the user interface construction is done.
def __init__(self, columns=None):
Undocumented
def _on_listcontainer__add_item(self, listcontainer):
Undocumented
def _on_listcontainer__remove_item(self, listcontainer, item):
Undocumented
def _on_listcontainer__edit_item(self, listcontainer, item):
Undocumented
def _on_listcontainer__selection_changed(self, listcontainer, selection):
Undocumented
def set_list_type(self, list_type):
Set list type.
def add_list_item(self, item):
Add item to list.
def add_list_items(self, item):
Add items to list.
def remove_list_item(self, item):
Remove item from list.
def update_list_item(self, item):
Update item in list.
def default_remove(self, item):
Undocumented
def add_item(self):

This must be implemented in a subclass if you want to be able to add items.

It should return the model you want to add to the list or None if you don't want anything to be added, eg the user cancelled creation of the model
def remove_item(self, item):
A subclass can implement this to get a notification after an item is removed. If it's not implemented default_remove will be called
def edit_item(self, item):
A subclass must implement this if you want to support editing of objects.
def selection_changed(self, selection):
This will be called when the selection changes in the ListDialog
def populate(self):
This will be called once after the user interface construction is done. It should return a list of objects which will initially be inserted