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
_-----------------------------------------------------------


Flattened version is here

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

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"
callback_info(args: ARRAY{STR}): TK_RASTER_CB
**** Create a callback out of the "args". This is used internally by the gui mechanism
clear
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)
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)
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)
world_to_raster(wx, wy: FLTD, out rx, out ry: FLTD)


Private

auto_display
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
const tk_widget_type: STR := "raster";

The Sather Home Page