class TK_CANVAS < $TK_WIDGET
****
A standard canvas with scrollbars


Flattened version is here

Ancestors
$TK_WIDGET



Public


Readable Attributes

Features
act_on(id: INT, args: ARRAY{STR})
**** Called by "GUI_APP_END" if self is the appropriate recipient. Go through the args - convert them into a CANVAS_CB and then call the appropriate function 0 = id 1 = button 2 = x 3 = y 4 on ward = coods
bind_event(event: $TK_EVENT,action: ROUT{TK_EVENT_INFO})
**** Bind the event "event" to the action "action", a bound routine which takes an EVENT_INFO as an argument The first argument to the callback is an index in to the list of bindings that corresponds to this "action"
bind_item(event:$TK_EVENT,item:TK_CTAG,action:ROUT{TK_CANVAS_CB})
**** Bind an arbitrary event to items with a particular tag. The callback routine "action" is invoked when the binding triggers
bind_item(event:$TK_EVENT,item:TK_CTAG,action:ROUT{TK_CANVAS_CB},deb:STR)
**** Usually for internal use Same as previous bind_item, but specify a string "deb" for debugging. An action_id is associated with this binding and this action_id is used to re-invoke the routine Negative numbers are for the action_id's to distinguish them from standard bindings
bind_item_motion(trigger,move:TK_CTAG,cb:ROUT{TK_CANVAS_CB},actnm:STR)
**** A specialized routine that very simply implements the "standard" kind of user directed motion - moving tagged items using the middle mouse button. Use individual bindings if you are interested in doing more sophisticated moves. Bind the items associated with "tag" to be moved all together using the second mouse button. A callback will be invoked when the motion is completed. This is mostly done with tcl code, so the sather end is not involved, making this sort of move faster with the dual process gui.
delete(tag: TK_CTAG)
**** Delete the item(s) associated with the tag "tag"
draw_line(x,y: ARRAY{FLT},tags:ARRAY{TK_CTAG},config:TK_LINE_CFG)
**** Draw a multipoint line
draw_line(x1,y1,x2,y2: FLT)
**** Draw line from (x1,y1) to (x2,y2)
draw_line(x1,y1,x2,y2: FLT,tags: ARRAY{TK_CTAG},config:TK_LINE_CFG)
draw_oval(x1,y1,x2,y2: FLT)
draw_oval(x1,y1,x2,y2: FLT,tags: ARRAY{TK_CTAG},config: TK_OVAL_CFG)
draw_poly(x:ARRAY{FLT},y:ARRAY{FLT})
draw_poly(x,y:ARRAY{FLT},tags: ARRAY{TK_CTAG},config: TK_POLY_CFG)
**** Draw a polygon
draw_rect(x1,y1,x2,y2: FLT)
draw_rect(x1,y1,x2,y2: FLT,tags: ARRAY{TK_CTAG},config: TK_RECT_CFG)
draw_rect_points(x,y: FLIST{FLT},tags:ARRAY{TK_CTAG})
**** Hack: The only way in tcl to draw points is to use small rectangles. This is a faster way to send a bunch of coordinates for lines that will be drawn as small rectangles. Don't use unless you have to ! These rectangles can be configured later using a TK_RECT_CFG. This can later be changed to make points be full fledged objects
draw_text(text: STR, x,y: FLT)
**** Draw "text" at (x,y)
draw_text(text: STR, x,y: FLT,tags:ARRAY{TK_CTAG},config: TK_CTEXT_CFG)
**** Draw text at x,y tagged with "tags" and with details specified by TK_CTEXT_CFG
embed_window(w: $TK_WIDGET,x,y: FLT)
embed_window(w: $TK_WIDGET,x,y:FLT,tags:ARRAY{TK_CTAG},
line_configure(tag: TK_CTAG,config: TK_LINE_CFG)
move(tag: TK_CTAG,byx,byy:FLT)
**** Move the item(s) associated with the tag "tag" by "byx","byy"
oval_configure(tag: TK_CTAG,config: TK_OVAL_CFG)
poly_configure(tag: TK_CTAG,config: TK_POLY_CFG)
raise_tag(t1,t2:TK_CTAG)
**** Raise items with tag "t1" above items with tag "t2". raise is a pSather keyword!
rect_configure(tag: TK_CTAG,config: TK_RECT_CFG)
scale(t: TK_CTAG,xorig,yorig,xscale,yscale: FLT)
**** Rescale all items associated with the tag "t"
text_configure(tag: TK_CTAG,config: TK_CTEXT_CFG)
**** (re)configure the item(s) associated with the tag "tag". See Tk_itemconfigure
wind_configure(tag: TK_CTAG,config: TK_CWIND_CFG)


Private

attr callback_map: TK_WIDGET_CALLBACKS{ROUT{TK_CANVAS_CB}};
attr callback_map: TK_WIDGET_CALLBACKS{ROUT{TK_CANVAS_CB}};
default_config: TK_CANVAS_CFG
default_init(c: TK_CANVAS_CFG)
tag_str(tags: ARRAY{TK_CTAG}): STR
tcl_list(a: ARRAY{TK_CTAG}): STR
tcl_list(a: FLIST{FLT}): STR
const tk_widget_type: STR := "canvas";

The Sather Home Page