Package param :: Module external :: Class Treeview
[hide private]
[frames] | no frames]

Class Treeview

source code


Nested Classes [hide private]

Inherited from Tkinter.Misc: getdouble, getint

Instance Methods [hide private]
 
__init__(self, master=None, cnf={}, **kw)
Construct a listbox widget with the parent MASTER.
source code
 
children(self, item, newchildren=None)
If newchildren is not specified, returns the list of children belonging to item.
source code
 
column(self, column, **kw)
Query or modify the options for the specified column.
source code
 
delete(self, items)
Deletes each of the items and all of their descendants.
source code
 
detach(self, items)
Unlinks all of the specified items from the tree.
source code
 
exists(self, item)
Returns 1 if the specified item is present in the tree, 0 otherwise.
source code
 
focus(self, item=None)
If item is specified, sets the focus item to item.
source code
 
heading(self, column, **kw)
Query or modify the heading options for the specified column.
source code
 
identify(self, x, y)
Returns a description of the widget component under the point given by x and y.
source code
 
index(self, item)
Returns the integer index of item within its parent's list of children.
source code
 
insert(self, parent, index, id=None, **kw)
Creates a new item.
source code
 
item(item, **kw)
Query or modify the options for the specified item.
source code
 
move(self, item, parent, index)
Moves item to position index in parent's list of children.
source code
 
next(self, item)
Returns the identifier of item's next sibling, or {} if item is the last child of its parent.
source code
 
parent(self, item)
Returns the ID of the parent of item, or {} if item is at the top level of the hierarchy.
source code
 
prev(self, item)
Returns the identifier of item's previous sibling, or {} if item is the first child of its parent.
source code
 
selection(self)
Returns the list of selected items
source code
 
selection_set(self, items)
items becomes the new selection.
source code
 
selection_add(self, items)
Add items to the selection
source code
 
selection_remove(self, items)
Remove items from the selection
source code
 
selection_toggle(self, items)
Toggle the selection state of each item in items.
source code
 
set(self, item, column, value=None)
If value is specified, sets the value of column column in item item, otherwise returns the current value.
source code

Inherited from Widget: instate, state

Inherited from Tkinter.BaseWidget: destroy

Inherited from Tkinter.BaseWidget (private): _do, _setup

Inherited from Tkinter.Misc: __contains__, __getitem__, __setitem__, __str__, after, after_cancel, after_idle, bbox, bell, bind, bind_all, bind_class, bindtags, cget, clipboard_append, clipboard_clear, clipboard_get, colormodel, columnconfigure, config, configure, deletecommand, event_add, event_delete, event_generate, event_info, focus_displayof, focus_force, focus_get, focus_lastfor, focus_set, getboolean, getvar, grab_current, grab_release, grab_set, grab_set_global, grab_status, grid_bbox, grid_columnconfigure, grid_location, grid_propagate, grid_rowconfigure, grid_size, grid_slaves, image_names, image_types, keys, lift, lower, mainloop, nametowidget, option_add, option_clear, option_get, option_readfile, pack_propagate, pack_slaves, place_slaves, propagate, quit, register, rowconfigure, selection_clear, selection_get, selection_handle, selection_own, selection_own_get, send, setvar, size, slaves, tk_bisque, tk_focusFollowsMouse, tk_focusNext, tk_focusPrev, tk_menuBar, tk_setPalette, tk_strictMotif, tkraise, unbind, unbind_all, unbind_class, update, update_idletasks, wait_variable, wait_visibility, wait_window, waitvar, winfo_atom, winfo_atomname, winfo_cells, winfo_children, winfo_class, winfo_colormapfull, winfo_containing, winfo_depth, winfo_exists, winfo_fpixels, winfo_geometry, winfo_height, winfo_id, winfo_interps, winfo_ismapped, winfo_manager, winfo_name, winfo_parent, winfo_pathname, winfo_pixels, winfo_pointerx, winfo_pointerxy, winfo_pointery, winfo_reqheight, winfo_reqwidth, winfo_rgb, winfo_rootx, winfo_rooty, winfo_screen, winfo_screencells, winfo_screendepth, winfo_screenheight, winfo_screenmmheight, winfo_screenmmwidth, winfo_screenvisual, winfo_screenwidth, winfo_server, winfo_toplevel, winfo_viewable, winfo_visual, winfo_visualid, winfo_visualsavailable, winfo_vrootheight, winfo_vrootwidth, winfo_vrootx, winfo_vrooty, winfo_width, winfo_x, winfo_y

Inherited from Tkinter.Misc (private): _bind, _configure, _displayof, _getboolean, _getdoubles, _getints, _grid_configure, _nametowidget, _options, _register, _report_exception, _root, _substitute

Inherited from Tkinter.Pack: forget, info, pack, pack_configure, pack_forget, pack_info

Inherited from Tkinter.Place: place, place_configure, place_forget, place_info

Inherited from Tkinter.Grid: grid, grid_configure, grid_forget, grid_info, grid_remove, location

Inherited from Style: default, element_create, element_names, layout, map_style, theme_create, theme_names, theme_settings, theme_use

Inherited from Tkinter.Listbox: activate, curselection, get, itemcget, itemconfig, itemconfigure, nearest, scan_dragto, scan_mark, see, select_anchor, select_clear, select_includes, select_set, selection_anchor, selection_includes, xview, xview_moveto, xview_scroll, yview, yview_moveto, yview_scroll

Class Variables [hide private]

Inherited from Tkinter.Misc: _noarg_

Inherited from Tkinter.Misc (private): _subst_format, _subst_format_str, _tclCommands

Method Details [hide private]

__init__(self, master=None, cnf={}, **kw)
(Constructor)

source code 

Construct a listbox widget with the parent MASTER.

Valid resource names: background, bd, bg, borderwidth, cursor, exportselection, fg, font, foreground, height, highlightbackground, highlightcolor, highlightthickness, relief, selectbackground, selectborderwidth, selectforeground, selectmode, setgrid, takefocus, width, xscrollcommand, yscrollcommand, listvariable.

Overrides: Tkinter.Listbox.__init__
(inherited documentation)

children(self, item, newchildren=None)

source code 

If newchildren is not specified, returns the list of children belonging to item.

If newchildren is specified, replaces item's child list with newchildren. Items in the old child list not present in the new child list are detached from the tree. None of the items in newchildren may be an ancestor of item.

column(self, column, **kw)

source code 

Query or modify the options for the specified column. If no options are specified, returns a dictionary of option/value pairs. If a single option is specified, returns the value of that option. Otherwise, the options are updated with the specified values. The following options may be set on each column:

-id name
The column name. This is a read-only option. For example, [$pathname column #n -id] returns the data column associated with data column #n.
-anchor Specifies how the text in this column should be aligned with respect to the cell. One of n, ne, e, se, s, sw, w, nw, or center.
-width w
The width of the column in pixels. Default is something reasonable, probably 200 or so.

delete(self, items)

source code 
Deletes each of the items and all of their descendants. The root item may not be deleted. See also: detach.
Overrides: Tkinter.Listbox.delete

detach(self, items)

source code 
Unlinks all of the specified items from the tree. The items and all of their descendants are still present and may be reinserted at another point in the tree but will not be displayed. The root item may not be detached. See also: delete.

focus(self, item=None)

source code 
If item is specified, sets the focus item to item. Otherwise, returns the current focus item, or {} if there is none.
Overrides: Tkinter.Misc.focus_set

heading(self, column, **kw)

source code 

Query or modify the heading options for the specified column. Valid options are:

-text text
The text to display in the column heading.
-image imageName
Specifies an image to display to the right of the column heading.
-command script
A script to evaluate when the heading label is pressed.

identify(self, x, y)

source code 

Returns a description of the widget component under the point given by x and y. The return value is a list with one of the following forms:

heading #n
The column heading for display column #n.
separator #n
The border to the right of display column #n.
cell itemid #n
The data value for item itemid in display column #n.
item itemid element
The tree label for item itemid; element is one of text, image, or indicator, or another element name depending on the style.
row itemid
The y position is over the item but x does not identify any element or displayed data value.
nothing
The coordinates are not over any identifiable object.

See COLUMN IDENTIFIERS for a discussion of display columns and data columns.

index(self, item)

source code 
Returns the integer index of item within its parent's list of children.
Overrides: Tkinter.Listbox.index

insert(self, parent, index, id=None, **kw)

source code 
Creates a new item. parent is the item ID of the parent item, or the empty string {} to create a new top-level item. index is an integer, or the value end, specifying where in the list of parent's children to insert the new item. If index is less than or equal to zero, the new node is inserted at the beginning; if index is greater than or equal to the current number of children, it is inserted at the end. If -id is specified, it is used as the item identifier; id must not already exist in the tree. Otherwise, a new unique identifier is generated. returns the item identifier of the newly created item. See ITEM OPTIONS for the list of available options.
Overrides: Tkinter.Listbox.insert

item(item, **kw)

source code 
Query or modify the options for the specified item. If no -option is specified, returns a dictionary of option/value pairs. If a single -option is specified, returns the value of that option. Otherwise, the item's options are updated with the specified values. See ITEM OPTIONS for the list of available options.

move(self, item, parent, index)

source code 

Moves item to position index in parent's list of children. It is illegal to move an item under one of its descendants.

If index is less than or equal to zero, item is moved to the beginning; if greater than or equal to the number of children, it's moved to the end.

selection_set(self, items)

source code 
items becomes the new selection.
Overrides: Tkinter.Listbox.selection_set

set(self, item, column, value=None)

source code 
If value is specified, sets the value of column column in item item, otherwise returns the current value. See COLUMN IDENTIFIERS.