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


Ancestors
$TK_WIDGET



Public


Readable Attributes
attr actual_widget_name: STR; .. Included as actual_widget_name
**** Name of the actual widget
attr frame: TK_FRAME; .. Included as frame
**** Outer frame that holds widget + scrolls
attr hscroll_name,vscroll_name: STR; .. Included as hscroll_name
**** Scroll bar names
attr name: STR; .. Included as name
**** name of the full path to the widget proper
attr parent: $TK_WIDGET; .. Included as parent
**** which may contain scrollbars etc.
attr path_name: STR; .. Included as path_name
**** refers to the path to the outermost frame which may contain scrollbars etc.
attr hscroll_name,vscroll_name: STR; .. Included as vscroll_name
**** Scroll bar names

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
actual_widget: TK_GEN_WIDGET .. Included as actual_widget
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.
configure(cf: CFGINFO) .. Included as configure
**** Reconfigure the widget with the new configuration "cf" Unstated parameters of "cf" remain unchanged
create(parent: $TK_WIDGET): SAME .. Included as create
**** Create a new widget, specifying a particular parent widget/window.
create(parent: $TK_WIDGET,np: STR): SAME .. Included as create
**** Create a new widget, specifying a particular parent and a name for the widget. The name "np" controls what tcl name is used and is only useful just for debugging purposes
create(parent:$TK_WIDGET,np:STR,cf: CFGINFO,pack:TK_PACK): SAME .. Included as create
**** Actual widget creation routine. All the rest are wrappers.
___Arg_parent_specifies_the_container_parent_window/widget
___Arg_np_is_used_to_specify_a_widget_name_for_debugging
___Arg_cf_specifies_configuration_options_(a_parameter_of
___TK_WIDGET_INCL)
___Arg_pack_specifies_the_packing_options
___Returns_a_configured,_packed_widget
create(parent: $TK_WIDGET,np: STR, pack: TK_PACK): SAME .. Included as create
**** Create a new widget.
___Arg_parent_specifies_the_container_parent_window/widget
___Arg_np_is_used_to_specify_a_widget_name_for_debugging
___Arg_pack_specifies_the_packing_options
create(parent: $TK_WIDGET,cf: CFGINFO): SAME .. Included as create
**** Create a new widget
__Arg_parent_specifies_the_parent_window/widget._This_could
____be_a_#TK_ROOTWINDOW_or_a_TK_TOPLEVEL
____toplevel_win_::=_#TK_TOPLEVEL;
____this_win_:=_#<some_widget_class>(toplevel_win,
__Arg_cf_specifies_a_configuration_option_that_should_be_used
____by_this_widget._This_routine_is_declared_in_TK_WIDGET_INCL
____where_the_type_of_the_configuration_option_is_a_type_parameter
____CFGINFO,_which_is_usually_set_to_<widget_name>TK__CFG
create(parent: $TK_WIDGET,cf: CFGINFO,pack: TK_PACK): SAME .. Included as create
**** Create a new widget.
___Arg_parent_specifies_the_container_parent_window/widget
___Arg_cf_specifies_configuration_options_(a_parameter_of
___TK_WIDGET_INCL)
___Arg_pack_specifies_the_packing_options
create(parent: $TK_WIDGET,pack: TK_PACK): SAME .. Included as create
**** Create a new widget
__Arg_parent_specifies_the_container_parent_window/widget
__Arg_pack_specifies_the_location_of_the_widget_within_the
___parent_(packing).
create: SAME .. Included as create
delete(tag: TK_CTAG)
**** Delete the item(s) associated with the tag "tag"
destroy .. Included as destroy
**** Destroy the widget associated with self
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},
hscroll .. Included as hscroll
**** Create a horizontal scrollbar
hscroll: SAME .. Included as hscroll
is_eq(o:$TK_WIDGET): BOOL .. Included as is_eq
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
vscroll .. Included as vscroll
**** Add a vertical scrollbar
vscroll: SAME .. Included as vscroll
widget_name: STR .. Included as widget_name
wind_configure(tag: TK_CTAG,config: TK_CWIND_CFG)


Private

attr actual_widget_name: STR; .. Included as actual_widget_name
**** Name of the actual widget
arr_str(a: ARRAY{STR}): STR .. Included as arr_str
**** Print out an array version of the string, since ARRAY does not have a .str routien in the standar library.
attr bindings: A_LIST{ROUT{TK_EVENT_INFO}}; .. Included as bindings
**** Store the bindings
attr bindings: A_LIST{ROUT{TK_EVENT_INFO}}; .. Included as bindings
**** Store the bindings
attr callback_map: TK_WIDGET_CALLBACKS{ROUT{TK_CANVAS_CB}};
attr callback_map: TK_WIDGET_CALLBACKS{ROUT{TK_CANVAS_CB}};
deb(s: STR) .. Included as deb
**** Print out a debugging message
debug: BOOL .. Included as debug
**** Return the value of the debug flag
default_config: TK_CANVAS_CFG
default_init(c: TK_CANVAS_CFG)
default_packing: TK_PACK .. Included as default_packing
err(s: STR) .. Included as err
**** Print out an error message.
eval(a1: $STR) .. Included as eval
eval(a1,a2: $STR) .. Included as eval
eval(a1,a2,a3: $STR) .. Included as eval
eval(a1,a2,a3,a4: $STR) .. Included as eval
eval(a1,a2,a3,a4,a5: $STR) .. Included as eval
fix_tcl_name(s: STR): STR .. Included as fix_tcl_name
**** SEF:Eliminate problems with tcl name, returning the empty string if necessary.
flt_if_poss(s: STR,default: FLT): FLT .. Included as flt_if_poss
**** Convert the string "s" to a float and return it, if possible. If an error occurs in the conversion, return the "default" value
attr frame: TK_FRAME; .. Included as frame
**** Outer frame that holds widget + scrolls
attr hscroll_name,vscroll_name: STR; .. Included as hscroll_name
**** Scroll bar names
init(a_parent: $TK_WIDGET,name:STR,cfg: CFGINFO) .. Included as init
**** Creation of the widget and its frame
int_if_poss(s: STR,default: INT): INT .. Included as int_if_poss
**** Convert the string "s" to an integer and return it, if possible. If an error occurs in the conversion, return the "default" value
join(a1,a2: $STR): STR .. Included as join
attr name: STR; .. Included as name
**** name of the full path to the widget proper
attr parent: $TK_WIDGET; .. Included as parent
**** which may contain scrollbars etc.
attr path_name: STR; .. Included as path_name
**** refers to the path to the outermost frame which may contain scrollbars etc.
quote(s:STR): STR .. Included as quote
**** Return a (tcl) quoted version of the string "s"
register .. Included as register
**** Register this widget with the widget map so that subsequent callbacks that belong to this widget may be directed here.
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";
attr hscroll_name,vscroll_name: STR; .. Included as vscroll_name
**** Scroll bar names

The Sather Home Page