[GRASS5] Tk <-> C

Radim Blazek blazek at itc.it
Tue Sep 24 11:57:54 EDT 2002


Hi,

can anybody tell me how to start C function by click on Tk
button so that Tk interface doesn't wait until C function
ends. Like "DRAW" button in nviz. I cannot find the trick.

I have already tracked the chain in nviz (see below) but
I cannot find how is that done. My application always wait 
for C function end.

Thanks

Radim

--------------------------------------------------------------
./scripts/panel_main.tcl :
  button $BASE.redrawf.f2.exec -text DRAW -command { \
    ....
         {Nsurf_draw_all}
 
./src/nvizMain.c
main (){
    Tk_Main(argc, argv, NVIZ_AppInit);
 
./src/nvizAppInit.c
NVIZ_AppInit ( Tcl_Interp *interp          /* Interpreter for application. */ 
)
  mainWindow = Tk_MainWindow(interp);
 
  Ninit(interp, mainWindow);
 
./src/nviz_init.c
int Ninit(Tcl_Interp *interp, Tk_Window w)
{
  init_commands(interp, &data);
 
./src/init_commands.c
init_commands (Tcl_Interp *interp, Nv_data *data) {
  Tcl_CreateCommand(interp, "Nsurf_draw_all", Nsurf_draw_all_cmd, data, NULL);
 
./src/draw.c
Nsurf_draw_all_cmd ( ) {
  GS_set_cancel(0);
  surf_draw_all(data, interp);
 
surf_draw_all (Nv_data *dc, Tcl_Interp *interp) {




More information about the grass-dev mailing list