Main Page | Data Structures | Directories | File List | Data Fields | Globals

ProgMeter.c File Reference

Callbacks to allow libsadie to display a pop-up progress meter window. More...

#include <tcl.h>
#include <tk.h>
#include "tclsadie.h"

Go to the source code of this file.

Enumerations

enum  create_template_index { ADD_GUICMD, ADD_TITLE, max_add_index }
 Define command template slots for the meter creation command.
enum  update_template_index { UPD_GUICMD, UPD_GNUM, UPD_VALUE, max_upd_index }
 Define command template slots for the progress meter update command.
enum  destroy_template_index { DEL_GUICMD, DEL_GNUM, max_del_index }
 Define command template slots for the meter destruction command.

Functions

int ProgMeter_Create (const char *title, void *data)
 Create a pop-up progress meter widget.
int ProgMeter_Update (int gaugenum, double value, void *data)
 Modify the progress displayed by an existing progress meter.
int ProgMeter_Destroy (int gaugenum, void *data)
 Destroy a pop-up progress meter widget.


Detailed Description

Callbacks to allow libsadie to display a pop-up progress meter window.

If compiled with support for callback functions, the SADIE library can display the progress of certain operations with a progress meter implemented by the application using it; here is tclSadie's implementation. The Tcl_EvalObjv Tcl library function does most of the work of passing the necessary commands to the interpreter for each operation. We pass it temporary arrays of Tcl objects that are treated as command templates: sequences of slots with pre-defined roles that we fill with pointers to the objects.

Author:
University of Arizona Digital Image Analysis Lab
Date:
2004
Version:
Id
ProgMeter.c,v 2.4 2005/03/22 21:11:15 mmunro Exp

Definition in file ProgMeter.c.


Function Documentation

int ProgMeter_Create const char *  title,
void *  data
 

Create a pop-up progress meter widget.

There should already be a Tcl/Tk command that will create the widget within the current GUI in its initial state (no progress yet). Here we invoke it, passing it a title string for the widget.

Parameters:
[in] title the title string.
[in] data an opaque pointer to the saved tclSadie state data.
Returns:
An integer identifying the progress meter widget, zero on failure.

Definition at line 89 of file ProgMeter.c.

Referenced by tclsadie_app_init().

int ProgMeter_Destroy int  gaugenum,
void *  data
 

Destroy a pop-up progress meter widget.

There should already be a Tcl/Tk command that will destroy the widget within the current GUI, given its ID number, so we invoke it, returning any error status.

Parameters:
[in] data an opaque pointer to the saved tclSadie state data.
[in] gaugenum the code identifying the particular progress meter.
Returns:
An error status code (zero on failure).

Definition at line 192 of file ProgMeter.c.

Referenced by tclsadie_app_init().

int ProgMeter_Update int  gaugenum,
double  value,
void *  data
 

Modify the progress displayed by an existing progress meter.

The progress meter should already exist, and there should be a Tcl command that will update it, given an ID number and an indication of the current percentage progress. This invokes the command, and returns a value showing if the user clicked on a cancel button within the widget since the previous update.

Parameters:
[in] gaugenum the code identifying the particular progress meter.
[in] value the percentage progress the meter should display.
[in] data an opaque pointer to the saved tclSadie state data.
Returns:
A non-zero value for cancellation (by user selection or error).

Definition at line 138 of file ProgMeter.c.

Referenced by tclsadie_app_init().


Generated on Fri Jul 8 14:55:01 2005 for tclSadie by  doxygen 1.4.2