model_server/gala/src/dis_cmds.cxx
// Return a list of all entries in the given selection.
Return a list of all entries in the given selection.
Return a list of all entries in the given selection .
int dis_SelectionFromList (ClientData, Tcl_Interp* interp,
			     int argc, char** argv)
{
    if (argc < 3)
	TCL_EXECERR ("wrong number of arguments");
    const vchar* sourceList = (vchar*) argv[1];
    gString items = (vchar*)"";
    SelectionIterator sel((vchar*)argv[2]);
    vbool first = vTRUE;
    while (sel.Next()) {
        int index = sel.GetNext();
        gString cmd;
        cmd.sprintf((vchar*)"lindex {%s} %d", sourceList, index);
        Tcl_Eval(interp, (char*)(vchar*)cmd);
        if (first)
            first = vFALSE;
        else
            items += (vchar*)" ";
        items += (vchar*)Tcl_GetStringResult(interp);
    }
    Tcl_SetResult (interp, (char*)(vchar*)items, TCL_VOLATILE);
    return TCL_OK;
}
int dis_SelectionFromList ( ClientData , Tcl_Interp * interp , int argc , char * * argv ) { if ( argc < 3 ) TCL_EXECERR ( " " ) ; const vchar * sourceList = ( vchar * ) argv [ 1 ] ; gString items = ( vchar * ) " " ; SelectionIterator sel ( ( vchar * ) argv [ 2 ] ) ; vbool first = vTRUE ; while ( sel . Next ( ) ) { int index = sel . GetNext ( ) ; gString cmd ; cmd . sprintf ( ( vchar * ) " " , sourceList , index ) ; Tcl_Eval ( interp , ( char * ) ( vchar * ) cmd ) ; if ( first ) first = vFALSE ; else items += ( vchar * ) " " ; items += ( vchar * ) Tcl_GetStringResult ( interp ) ; } Tcl_SetResult ( interp , ( char * ) ( vchar * ) items , TCL_VOLATILE ) ; return TCL_OK ; }
Return a list of all entries in the given selection.
Return a list of all entries in the given selection .
// Get list of selected items.