Package topo :: Package tkgui :: Module editor :: Class EditorCanvas
[hide private]
[frames] | no frames]

Class EditorCanvas

source code

  Tkinter.Misc --+            
                 |            
Tkinter.BaseWidget --+        
                     |        
      Tkinter.Pack --+        
                     |        
     Tkinter.Place --+        
                     |        
      Tkinter.Grid --+        
                     |        
        Tkinter.Widget --+    
                         |    
            Tkinter.Canvas --+
                             |
                            EditorCanvas

EditorCanvas extends the Tk Canvas class. There are 3 modes that determine the effect of mouse events in the Canvas A Canvas can accept new objects, move objects and make connections between them. The intended use of this class is as the main canvas in a Topographica model-editing GUI.
Nested Classes [hide private]

Inherited from Tkinter.Misc: getdouble, getint

Instance Methods [hide private]
 
__init__(self, root=None, width=600, height=600)
Construct a widget with the parent widget MASTER, a name WIDGETNAME and appropriate options.
source code
 
key_press(self, event)
What happens when a key is pressed.
source code
 
left_click(self, event)
What is to happen if the left button is pressed.
source code
 
left_click_drag(self, event)
What is to happen if the mouse is dragged while the left button is pressed.
source code
 
left_release(self, event)
What is to happen when the left mouse button is released.
source code
 
left_double_click(self, event)
What is to happen if the left button is double clicked.
source code
 
right_click(self, event)
What is to happen if the right button is pressed.
source code
 
right_release(self, event)
What is to happen when the right mouse button is released (bound to the menu).
source code
 
change_mode(self, char)
Changes the mode of the canvas, i.e., what mouse events will do.
source code
 
refresh(self) source code
 
enlarge_scale(self) source code
 
reduce_scale(self) source code
 
toggle_auto_refresh(self) source code
 
toggle_normalize(self) source code
 
init_move(self, x, y)
Determine if click was on an object.
source code
 
update_move(self, x, y)
If dragging an object, refresh its position
source code
 
end_move(self, x, y)
If dropping an object, remove focus and refresh.
source code
 
init_connection(self, x, y)
Determine if click was on an object, and retain if so.
source code
 
update_connection(self, x, y)
Update connection's position.
source code
 
end_connection(self, x, y)
Determine if the connection has been dropped on an object.
source code
 
get_connection_xy(self, x, y)
Return connection at given x, y (None if no connection).
source code
 
create_object(self, x, y)
Create a new object.
source code
 
add_object(self, obj)
Add a new object to the Canvas.
source code
 
add_object_to_back(self, obj)
Add a new object to the Canvas at back of the list.
source code
 
remove_object(self, obj)
Remove an object from the canvas.
source code
 
toggle_object_density(self) source code
 
toggle_object_activity(self) source code
 
get_object_xy(self, x, y)
Return object at given x, y (or None if no object).
source code
 
show_properties(self, focus)
Show properties of an object or connection, and remove the focus.
source code
 
delete_focus(self, focus)
Tell a connection or object to delete itself.
source code
 
redraw_objects(self, index=None)
Redraw all the objects in the canvas.
source code
 
move_to_front(self, obj) source code
 
move_forward(self, obj) source code
 
move_to_back(self, obj) source code
 
show_hang_list(self, event) source code
 
save_snapshot(self) source code
 
set_display_mode(self, mode) source code
 
set_tool_bars(self, arrow_tool, connection_tool, object_tool) source code
 
none(self, x, y) source code
 
get_xy(self, x, y)
Returns the connection or object at this x, y position or None if there is not one.
source code

Inherited from Tkinter.Canvas: addtag, addtag_above, addtag_all, addtag_below, addtag_closest, addtag_enclosed, addtag_overlapping, addtag_withtag, bbox, canvasx, canvasy, coords, create_arc, create_bitmap, create_image, create_line, create_oval, create_polygon, create_rectangle, create_text, create_window, dchars, delete, dtag, find, find_above, find_all, find_below, find_closest, find_enclosed, find_overlapping, find_withtag, focus, gettags, icursor, index, insert, itemcget, itemconfig, itemconfigure, lift, lower, move, postscript, scale, scan_dragto, scan_mark, select_adjust, select_clear, select_from, select_item, select_to, tag_bind, tag_lower, tag_raise, tag_unbind, tkraise, type, xview, xview_moveto, xview_scroll, yview, yview_moveto, yview_scroll

Inherited from Tkinter.Canvas (private): _create

Inherited from Tkinter.BaseWidget: destroy

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

Inherited from Tkinter.Misc: __getitem__, __setitem__, __str__, after, after_cancel, after_idle, 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, 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, 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

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, root=None, width=600, height=600)
(Constructor)

source code 
Construct a widget with the parent widget MASTER, a name WIDGETNAME and appropriate options.
Overrides: Tkinter.BaseWidget.__init__
(inherited documentation)

left_double_click(self, event)

source code 
What is to happen if the left button is double clicked. The same for all modes - show the properties for the clicked item. Gets object or connection at this point and gives it the focus.

redraw_objects(self, index=None)

source code 

Redraw all the objects in the canvas.

If non-None, the index specifies that only the objects below that index need drawing.