model_server/gala/src/dis_cmds.cxx
// Utility to find a item given its name and interpreter.
// NOTE - This function may change interp to the item's interpreter.
//        (I know, I should think of a better way.)
Utility to find a item given its name and interpreter.
NOTE - This function may change interp to the item's interpreter.
(I know, I should think of a better way.)
Utility to find a item given its name and interpreter . NOTE - This function may change interp to the item ' s interpreter . ( I know I should think of a better way . )
void* dis_findItem(Tcl_Interp*& interp, vchar* name)
{
   void* myItem = NULL;
    char* gdText = Tcl_GetVar (interp, "gd", TCL_GLOBAL_ONLY);
    int gdialog_id = -1;
    if (gdText) 
		gdialog_id = atoi (gdText);
    GDialog* gd = NULL;
    if (gdialog_id > 0 )
        gd = GDialog::FindGDialog (gdialog_id);
    if (gd)
        myItem = (gdTextItem*)gd->FindItem(vnameInternGlobal(name) );
    if (myItem == NULL) {
        Viewer* vr;
        View *v;
        Viewer::GetExecutingView (vr, v);
        if (vr && v) {
            myItem = (gdTextItem*)v->FindItem (name);
            interp = v->interp();
        }
    }
    return (myItem);
}
void * dis_findItem ( Tcl_Interp * & interp , vchar * name ) { void * myItem = NULL ; char * gdText = Tcl_GetVar ( interp , " " , TCL_GLOBAL_ONLY ) ; int gdialog_id = -1 ; if ( gdText ) gdialog_id = atoi ( gdText ) ; GDialog * gd = NULL ; if ( gdialog_id > 0 ) gd = GDialog :: FindGDialog ( gdialog_id ) ; if ( gd ) myItem = ( gdTextItem * ) gd -> FindItem ( vnameInternGlobal ( name ) ) ; if ( myItem == NULL ) { Viewer * vr ; View * v ; Viewer :: GetExecutingView ( vr , v ) ; if ( vr && v ) { myItem = ( gdTextItem * ) v -> FindItem ( name ) ; interp = v -> interp ( ) ; } } return ( myItem ) ; }
Utility to find a item given its name and interpreter.
Utility to find a item given its name and interpreter .
// Try getting the item from the interpreter's dialog. // If we haven't found the item, try using the executing view. // Switch over to the view's interpreter.