Top Up Prev Next Bottom Contents Index Search

14.7 Tcl/Tk Stars

The CGCTclTkTarget class defines the tkSetup stream for Tcl/Tk stars.There is no special code generation function for this stream, so its name must be used with addCode . This is usually done from within the initCode method.

addCode(codeblock, "tkSetup"); The following functions, which are defined in the file tkMain.c , can be used within codeblocks of Tcl/Tk stars in the CGC domain.


void errorReport (char* message)

This functions creates a pop-up window containing message.


void makeEntry (char* window, char* name, char* desc, char* initValue, Tcl CmdProc* callback)

This function creates an entry box in a window. The name of the entry box must be unique (e.g. derived from the star name). The description of the entry box is desc. The initial value in the entry box is initValue.

A callback function is called whenever the user enters a RET in the box. The argument to the callback function will be the value that the user has put in the entry box. The return value of the callback function should be TCL_OK.


void makeButton (char* window, char* name, char* desc, Tcl CmdProc* callback)

This function creates a push button in a window. The name of the push button must be unique (e.g. derived from the star name). The description of the push button is desc.

A callback function is called whenever the user pushes the button. The return value of the callback function should be TCL_OK.


void makeScale (char* window, char* name, char* desc, int position, Tcl CmdProc* callback)

This function creates a scale (with slider) in a window. The name of the scale must be unique (e.g., derived from the star name). The description of the push button is desc. The initial position of the slider must be between 0 and 100.

A callback function is called whenever the user moves the slider in the scale. The argument to the callback function will be the current position of the slider, which can range from 0 to 100. The return value of the callback function should be TCL_OK.


void displaySliderValue (char* window, char* name, char* value)

This function displays a value associated with a scale's slider. The scale is identified by its name and the window it is in. This function must be called by the user of the slider. Only the first 6 characters of the value will be used.



Top Up Prev Next Bottom Contents Index Search

Copyright © 1990-1997, University of California. All rights reserved.