コード例 #1
0
ファイル: dm-X.c プロジェクト: cciechad/brlcad
int
X_dm_init(struct dm_list	*o_dm_list,
	  int			argc,
	  char			*argv[])
{
    struct bu_vls vls;

    dm_var_init(o_dm_list);

    /* register application provided routines */
    cmd_hook = X_dm;

    Tk_DeleteGenericHandler(doEvent, (ClientData)NULL);
    if ((dmp = dm_open(interp, DM_TYPE_X, argc-1, argv)) == DM_NULL)
	return TCL_ERROR;

    /* keep display manager in sync */
    dmp->dm_perspective = mged_variables->mv_perspective_mode;

    eventHandler = X_doevent;
    Tk_CreateGenericHandler(doEvent, (ClientData)NULL);
    (void)DM_CONFIGURE_WIN(dmp);

    bu_vls_init(&vls);
    bu_vls_printf(&vls, "mged_bind_dm %s", bu_vls_addr(&pathName));
    Tcl_Eval(interp, bu_vls_addr(&vls));
    bu_vls_free(&vls);

    return TCL_OK;
}
コード例 #2
0
ファイル: dm-wgl.c プロジェクト: cciechad/brlcad
int
Wgl_dm_init(struct dm_list	*o_dm_list,
	    int			argc,
	    char		*argv[])
{
    struct bu_vls vls;

    dm_var_init(o_dm_list);

    /* register application provided routines */
    cmd_hook = Wgl_dm;

    Tk_DeleteGenericHandler(doEvent, (ClientData)NULL);

    if ((dmp = dm_open(interp, DM_TYPE_WGL, argc-1, argv)) == DM_NULL)
	return TCL_ERROR;

    /*XXXX this eventually needs to move into Wgl's private structure */
    dmp->dm_vp = &view_state->vs_vop->vo_scale;
    dmp->dm_perspective = mged_variables->mv_perspective_mode;

    eventHandler = Wgl_doevent;
    Tk_CreateGenericHandler(doEvent, (ClientData)NULL);
    (void)DM_CONFIGURE_WIN(dmp);

    bu_vls_init(&vls);
    bu_vls_printf(&vls, "mged_bind_dm %s", bu_vls_addr(&pathName));
    Tcl_Eval(interp, bu_vls_addr(&vls));
    bu_vls_free(&vls);

    return TCL_OK;
}
コード例 #3
0
ファイル: kit.c プロジェクト: iivvoo-abandoned/circus
kit::kit()
{
	created++;

	if(interp != NULL)	// already initialized?
		return;

	interp = Tcl_CreateInterp();
	if (Tcl_Init(interp) == TCL_ERROR)
	{
		cerr << "Tcl_Init(interp) failed: " << interp->result << endl;
		exit(1);
	}
	if (Tk_Init(interp) == TCL_ERROR)
	{
		cerr << "Tk_Init(interp) failed: " << interp->result << endl;
		exit(1);
	}
	if (Tix_Init(interp) == TCL_ERROR) 
	{
		cerr << "Tix_Init(interp) failed: " << interp->result << endl;
		exit(1);
	}
	Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);

	/*
	 * We need more X event information that tk can provide, so install
	 * a handler for *each* event, to store a pointer to the Xevent
	 * structure, which has the information we need 
	 */
	Tk_CreateGenericHandler(dispatchX, NULL);
}