model_server/gala/src/dis_cmds.cxx
// Important warning:  do not put anything which could possibly call veventStopProcessing
// in the tcl callback--if you do the spinner will increment itself forever...
Important warning:  do not put anything which could possibly call veventStopProcessing
in the tcl callback--if you do the spinner will increment itself forever
Important warning : do not put anything which could possibly call veventStopProcessing in the tcl callback -- if you do the spinner will increment itself forever
int dis_gdInitNumberSpinner(ClientData, Tcl_Interp* interp, int argc, char *argv[])
{
	gInit(dis_gdInitNumberSpinner);
	int nRet=TCL_ERROR;
	if (argc>=4)
	{
		nRet=TCL_OK;
		gdNumberSpinner* myItem= (gdNumberSpinner *) dis_findItem(interp, (vchar*) argv[2]  );
		if (!myItem) TCL_EXECERR1("Item for dialog not found : ", argv[2]);
		myItem->SetTclCmd((vchar*)argv[3]);
	}
	return nRet;
}
int dis_gdInitNumberSpinner ( ClientData , Tcl_Interp * interp , int argc , char * argv [ ] ) { gInit ( dis_gdInitNumberSpinner ) ; int nRet = TCL_ERROR ; if ( argc >= 4 ) { nRet = TCL_OK ; gdNumberSpinner * myItem = ( gdNumberSpinner * ) dis_findItem ( interp , ( vchar * ) argv [ 2 ] ) ; if ( ! myItem ) TCL_EXECERR1 ( " " , argv [ 2 ] ) ; myItem -> SetTclCmd ( ( vchar * ) argv [ 3 ] ) ; } return nRet ; }
Important warning:  do not put anything which could possibly call veventStopProcessing
in the tcl callback--if you do the spinner will increment itself forever...
Important warning : do not put anything which could possibly call veventStopProcessing in the tcl callback -- if you do the spinner will increment itself forever ...
/*
		
		  //have to save this here because for some reason setting min also changes value...
		  int nCur=myItem->GetValue();
		  //allow for overide of values stored in resource file
		  if (argc>=5)
		  {
		  int curMax=myItem->GetMax();
		  int curMin=myItem->GetMin();
		  int nMin=curMin;
		  //allows for a "" argument to just set the max
		  if ( argv[4] && strcmp(argv[4], "")  )
		  {
		  nMin=atoi(argv[4]);
		  }
		  
			int nMax= argc>=6? atoi(argv[5]): curMax;
			
			  if (nMin<nMax)
			  {
			  myItem->SetMin(nMin);
			  myItem->SetMax(nMax);
			  
				if (nCur<nMin|| nCur>nMax)
				{
				//vchar buffer[12];
				//sprintf((char *)buffer,"%d", nMin);
				//myItem->SetInterpVariable( (vchar *) myItem->GetTag(), (vchar *) (char *) buffer);
				myItem->SetValue(nMin);
				//myItem->Inval(vwindowINVAL_IMMEDIATE);
				}
				}
				
	}*/