class TK_RASTER < $TK_WIDGET
****
Raster Widget. This is meant for fast, pixel-level drawing. It has a direct interface to C using arrays of FLTD, and currently will only work with the SingleProcessGui (the arrays would have to be converted into strings to make use of the current socket interface, thus loosing all the speed benefits). For more elaborate drawing, where speed is not a big issue, consider using the TK_CANVAS widget: it supports treating drawn elements as objects and manipulating them in various ways.
_
Implementation of Drawing: contrary to all other widgets, these directly call the C functions for the sake of efficiency
_
Implementation of Refresh: Don't know if this is intended by the authors (...) the C functions __don't__ redisplay the widget so one may set widget.auto_display to true then this is done after every drawing call or one may 'manually' call widget.display This required one patch to the raster sources
_
Implementation of Coordination Transforms: These do have problems or I misinterpret their intended functionality
_-----------------------------------------------------------


Ancestors
$TK_WIDGET



Public


Readable Attributes
attr auto_display: BOOL;
**** if true, the raster is redrawn after every operation
attr current_env: TK_RASTER_ENV;
**** denotes the current environment
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.

Writable Attributes
attr auto_display: BOOL;
**** if true, the raster is redrawn after every operation

Features
act_on(id: INT, args: ARRAY{STR})
bind_action(event: $TK_EVENT,action:ROUT{TK_RASTER_CB})
**** Bind an event "event" to the action bound routine "action"
bind_event(event: $TK_EVENT,action: ROUT{TK_EVENT_INFO}) .. Included as bind_event
**** 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"
callback_info(args: ARRAY{STR}): TK_RASTER_CB
**** Create a callback out of the "args". This is used internally by the gui mechanism
clear
configure(cf: CFGINFO) .. Included as configure
**** Reconfigure the widget with the new configuration "cf" Unstated parameters of "cf" remain unchanged
create(parent: $TK_WIDGET, np: STR, cf: TK_RASTER_CFG, pack: TK_PACK)
create_env: TK_RASTER_ENV
**** Create a new drawing environment (similar to a GC)
destroy .. Included as destroy
**** Destroy the widget associated with self
display
draw_lines(coords: ARRAY{FLTD})
**** Draw directly using an array of coods
draw_point(x, y: FLTD)
**** the raster inconsistently defines x, y as integers
draw_points(coords: ARRAY{FLTD})
draw_rectangle(x0, y0, x1, y1: FLTD)
fill_polygon(coords: ARRAY{FLTD})
fill_rectangle(x0, y0, x1, y1: FLTD)
is_eq(o:$TK_WIDGET): BOOL .. Included as is_eq
raster_to_world(rx, ry: FLTD, out wx, out wy: FLTD)
set_env(env: TK_RASTER_ENV)
**** precondition checks if this environment is ours ? you may as well use env.activate with the effect that the precondition will never be broken
set_world(wx0, wy0, wx1, wy1: FLTD)
widget_name: STR .. Included as widget_name
**** In the default case the path and widget names are the same
world_to_raster(wx, wy: FLTD, out rx, out ry: FLTD)


Private

actual_widget_name: STR .. Included as actual_widget_name
**** Sometimes the "real" tk widget is nested within an outer frame. Configuration options must then be passed to 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.
auto_display
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 c_raster: EXT_OB;
**** a pointer to this widget's tkRaster structure
attr c_raster: EXT_OB;
**** a pointer to this widget's tkRaster structure
attr callbacks: TK_WIDGET_CALLBACKS{ROUT{TK_RASTER_CB}};
**** all defined callbacks
attr callbacks: TK_WIDGET_CALLBACKS{ROUT{TK_RASTER_CB}};
**** all defined callbacks
attr current_env: TK_RASTER_ENV;
**** denotes the current environment
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: CFGINFO .. Included as default_config
**** Default configuration information
default_init(c: CFGINFO) .. Included as default_init
**** Default initialization hook
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
init(prnt: $TK_WIDGET,nm: STR,cf: CFGINFO) .. Included as init
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.
const tk_widget_type: STR := "raster";
create(parent: $TK_WIDGET): SAME .. Included as widget_create
**** Create a new widget, specifying a particular parent widget/window.
create(parent: $TK_WIDGET,np: STR): SAME .. Included as widget_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, pack: TK_PACK): SAME .. Included as widget_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,np:STR,cf: CFGINFO,pack:TK_PACK): SAME .. Included as widget_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,pack: TK_PACK): SAME .. Included as widget_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(parent: $TK_WIDGET,cf: CFGINFO): SAME .. Included as widget_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 widget_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: SAME .. Included as widget_create

The Sather Home Page