Package schrodinger :: Package ui :: Module widgettable :: Class WidgetTable
[hide private]
[frames] | no frames]

Class WidgetTable

                                          object --+
                                                   |
_Pmw.Pmw_1_3_3.lib.PmwBase.MegaArchetype --+       |
                                           |       |
       _Pmw.Pmw_1_3_3.lib.PmwBase.MegaWidget --+   |
                                               |   |
                                 _ScrolledDouble --+
                                                   |
                                                  WidgetTable

The table class with scroll bars

Instance Methods [hide private]
 
__init__(self, parent, bleachedcolor='gray90', selectedcolor='LemonChiffon', titlebarcolor='LightSkyBlue', rowheight=25, titlebarheight=None, showtitlebar=False, hull_width=200, hull_height=200, hscrollmode='dynamic', vscrollmode='dynamic', multiselect=False, resizable_columns=False, cellselect=False, sortable=False)
x.__init__(...) initializes x; see help(type(x)) for signature
 
exists(self)
Returns True if Tkinter widget for this table exists.
 
setRowHeight(self, rowheight)
Change the hight of the rows to a new value
 
invokeSelectCallback(self)
Call the row/cell select callback
 
_scrollbarToggleCallback(self)
Gets called everytime the scroll bar appears or disappears If scroll bar just appeared, make columns narrower by 22 pixels; If scroll bar just disappered, make columns narrower by 22 pixels.
 
_nextRowId(self)
 
_nextColId(self)
 
__iter__(self)
 
_getRowIterator(self)
 
_getColumnIterator(self)
 
_getCellIterator(self)
 
setCellCallback(self, function)
Use this to specify the default command for each widget.
 
setCellClickCallback(self, function)
Use this to specify a handler for cell click events.
 
setRowCallback(self, command_function)
Use this to specify the command that should be called when a row is selected The function is called without arguments.
 
setSelectCallback(self, function)
Use this to specify the command that should be called when selection is changed.
 
setCellResizeCallback(self, command_function)
Use this to specify the command that should be called when a cell has been resized.
 
setTableResizeCallback(self, command_function)
Use this to specify the command that should be called when the table has been resized.
 
setColumnCallback(self, colid, command_function)
Use this to set the function to be called when a cell in this column is clicked on.
 
_removeColumn(self, colid)
Removes the specified column from the table Public use alias: del table.column[x]
 
addColumn(self, type, columnwidth=None, resizable=True, **kwargs)
Add a column of type <type> to the table.
 
_repositionTable(self, ignored)
Gets called when the table is resized
 
resizeCells(self, dohidden=True)
Call resize callback for any cells that need to be resized.
 
_resizeOneRow(self, dohidden)
Finds a row that needs to be resized and calls resize callback on it.
 
_resizeUnsizedColumns(self)
Determine how much space is used by all sized columns.
 
addRow(self)
 
_position(self)
 
_removeRow(self, rowid)
Removes the specified row from the table Public use alias: del table.row[x] Returns True if the row (or a cell in it) was selected.
 
removeAllRows(self)
Removes all rows from the table
 
removeRows(self, rowid_list)
Removes the rows in the specified list of rowids
 
removeSelectedRows(self)
Removes the selected rows from the table
 
removeSelectedRow(self)
Alias to removeSelectedRows()
 
enable(self)
Disable the table
 
disable(self)
Disable the table
 
selectAllRows(self)
Select all rows (multi-select tables only)
 
selectAll(self)
Select all rows/cells (multi-select tables only)
 
_clearSelection(self)
Deselect all selected rows w/o calling the select callback
 
clearSelection(self)
Deselect all selected rows/cells and call the select callback
 
invertSelection(self)
Deselect all selected rows/cells and select all unselected rows/cells.
 
selected(self)
Returns a list of selected rows or cells (objects)
 
_tryResizingColumn(self, column, x)
Determine if this event is for column resizing.
 
_titleClick(self, e)
Gets called when a title cell is clicked on, use it with sort() to sort columns, if allowColumnSort is set to True
 
_cellDrag(self, e)
Called when a drag occurs inside a cell.
 
_cellRelease(self, e)
Called when mouse was released.
 
_wallLeave(self, ignored)
Called when cursor leaves a cell wall (goes into clipping pane)
 
_cellHover(self, e)
Called when cursor is moved within a
 
_widgetClick(self, e, ctrldown=False, shiftdown=False)
Gets called when the wall of a cell is clicked on
 
_controlWidgetClick(self, e)
 
_shiftWidgetClick(self, e)
 
sort(self, colid)
Sorts the entire table based on data in column given by column_name, using the comparator sortfunc
 
up(self, ignored=None)
Gets called when the user presses the UP button Selects the previous row
 
down(self, ignored=None)
Gets called when the user presses the DOWN button Selects the next row
 
left(self, ignored=None)
Gets called when the user presses the LEFT button Selects the cell to the left.
 
right(self, ignored=None)
Gets called when the user presses the RIGHT button Selects the cell to the right.
 
bindEvents(self)
Bind the up, down, left, right keys to the table
 
unbindEvents(self)
 
_isRowVisible(self, row)
Returns True if this row is within the visible table area.
 
scrollToShowRow(self, row)
If specified row is off the table, scroll the table so that it is in view
 
_cellClicked(self, cell, ctrldown, shiftdown)
Select the specified row If not multi-select, deselects the other rows Redefine here so that it will automatically scroll if a row is selected off screen

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Inherited from _ScrolledDouble: destroy, interior, reposition, xview, yview

Inherited from _Pmw.Pmw_1_3_3.lib.PmwBase.MegaWidget: after, after_cancel, after_idle, bbox, bell, bind, bind_all, bind_class, bindtags, clipboard_append, clipboard_clear, clipboard_get, colormodel, columnconfigure, config, deletecommand, event_add, event_delete, event_generate, event_info, focus, focus_displayof, focus_force, focus_get, focus_lastfor, focus_set, forget, getboolean, getvar, grab_current, grab_release, grab_set, grab_set_global, grab_status, grid, grid_bbox, grid_columnconfigure, grid_configure, grid_forget, grid_info, grid_location, grid_propagate, grid_remove, grid_rowconfigure, grid_size, grid_slaves, image_names, image_types, info, keys, lift, lower, mainloop, nametowidget, option_add, option_clear, option_get, option_readfile, pack, pack_configure, pack_forget, pack_info, pack_propagate, pack_slaves, place, place_configure, place_forget, place_info, 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 _Pmw.Pmw_1_3_3.lib.PmwBase.MegaArchetype: __getitem__, __setitem__, addoptions, cget, component, componentaliases, componentgroup, components, configure, createcomponent, createlabel, defineoptions, destroycomponent, hulldestroyed, initialiseoptions, isinitoption, options

Properties [hide private]
  row
  column
  cell

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent, bleachedcolor='gray90', selectedcolor='LemonChiffon', titlebarcolor='LightSkyBlue', rowheight=25, titlebarheight=None, showtitlebar=False, hull_width=200, hull_height=200, hscrollmode='dynamic', vscrollmode='dynamic', multiselect=False, resizable_columns=False, cellselect=False, sortable=False)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: _Pmw.Pmw_1_3_3.lib.PmwBase.MegaArchetype.__init__

exists(self)

 

Returns True if Tkinter widget for this table exists. Callbacks should call this before attempting to access the table.

setCellCallback(self, function)

 

Use this to specify the default command for each widget. <function> should accept one argument: cell object clicked. NOTE: Only works with widgets that have command attribute.

setCellClickCallback(self, function)

 

Use this to specify a handler for cell click events. <function> should accept 4 arguments: <event>, <cell>, <ctrldown>, <shiftdown>. <function> should return True if the event should still be used for cell selection, False if not.

setSelectCallback(self, function)

 

Use this to specify the command that should be called when selection is changed. Use selected() function to find out selected row(s) or cell(s). <function> should be a callable (no arguments)

setCellResizeCallback(self, command_function)

 

Use this to specify the command that should be called when a cell has been resized. <command> should be a callable that takes one argument: the object for the cell that was resized.

setTableResizeCallback(self, command_function)

 

Use this to specify the command that should be called when the table has been resized. <command> should be callable and take no arguments.

setColumnCallback(self, colid, command_function)

 

Use this to set the function to be called when a cell in this column is clicked on. The function should take one argument: cell object.

addColumn(self, type, columnwidth=None, resizable=True, **kwargs)

 

Add a column of type <type> to the table. Returns the reference to the created column which can be later used to retrieve the cells.

<kwargs> should be any keywords that the widget accepts of the column accepts. For example, for a Button column, acceptable arguments are text, command, etc.

resizeCells(self, dohidden=True)

 

Call resize callback for any cells that need to be resized. First resized visible cells, then hidden cells.

_resizeOneRow(self, dohidden)

 

Finds a row that needs to be resized and calls resize callback on it. Preferance is given to visible rows.

_resizeUnsizedColumns(self)

 

Determine how much space is used by all sized columns. Divide the rest of the space evenly between unsized columns and resize each unsized column to that width

_tryResizingColumn(self, column, x)

 

Determine if this event is for column resizing. If so, activate resizing and return True; otherwise False.

_cellDrag(self, e)

 

Called when a drag occurs inside a cell. If column is being resized, resizes the VISIBLE cells of the column

_cellRelease(self, e)

 

Called when mouse was released. If column was being resized, resizes all cells in the column that are NOT visible

left(self, ignored=None)

 

Gets called when the user presses the LEFT button Selects the cell to the left. Applicable only in cell-select tables.

right(self, ignored=None)

 

Gets called when the user presses the RIGHT button Selects the cell to the right. Applicable only in cell-select tables.

_isRowVisible(self, row)

 

Returns True if this row is within the visible table area. To be used internally only


Property Details [hide private]

row

Get Method:
_getRowIterator(self)

column

Get Method:
_getColumnIterator(self)

cell

Get Method:
_getCellIterator(self)