Commit 830f3326 authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

implemented universal catch{} for all commands sent from c to tcl to minimize...

implemented universal catch{} for all commands sent from c to tcl to minimize (eradicate?) stderr output.
parent a69b826c
......@@ -658,7 +658,7 @@ void canvas_reflecttitle(t_canvas *x)
/*fprintf(stderr,"%d %d %d %d %d\n", glist_istoplevel(x), !x->gl_isgraph,
x->gl_isgraph && x->gl_havewindow, x->gl_loading,
x->gl_dirty);*/
sys_vgui("catch { wm title .x%lx {%s%c%s - %s} }\n",
sys_vgui("wm title .x%lx {%s%c%s - %s}\n",
x, x->gl_name->s_name, (x->gl_dirty? '*' : ' '), namebuf,
canvas_getdir(x)->s_name);
//}
......@@ -724,7 +724,7 @@ void canvas_draw_gop_resize_hooks(t_canvas* x)
}
else{
sys_vgui("catch { .x%lx.c delete GOP_resblob ; .x%lx.c delete GOP_movblob ; } \n", x, x); //delete the GOP_resblob and GOP_movblob
sys_vgui(".x%lx.c delete GOP_resblob ; .x%lx.c delete GOP_movblob ;\n", x, x); //delete the GOP_resblob and GOP_movblob
}
}
/*****************************************************************************/
......
......@@ -1809,7 +1809,7 @@ void canvas_setcursor(t_canvas *x, unsigned int cursornum)
}
if (xwas != x || cursorwas != cursornum)
{
sys_vgui("catch {.x%lx configure -cursor %s}\n", x, cursorlist[cursornum]);
sys_vgui(".x%lx configure -cursor %s\n", x, cursorlist[cursornum]);
xwas = x;
cursorwas = cursornum;
}
......@@ -1980,12 +1980,12 @@ void canvas_vis(t_canvas *x, t_floatarg f)
{
//fprintf(stderr,"new window\n");
canvas_create_editor(x);
sys_vgui("catch {pdtk_canvas_new .x%lx %d %d +%d+%d %d}\n", x,
sys_vgui("pdtk_canvas_new .x%lx %d %d +%d+%d %d\n", x,
(int)(x->gl_screenx2 - x->gl_screenx1),
(int)(x->gl_screeny2 - x->gl_screeny1),
(int)(x->gl_screenx1), (int)(x->gl_screeny1),
x->gl_edit);
sys_vgui("catch {pdtk_canvas_set_font .x%lx %d}\n", x, x->gl_font);
sys_vgui("pdtk_canvas_set_font .x%lx %d\n", x, x->gl_font);
canvas_reflecttitle(x);
x->gl_havewindow = 1;
......
......@@ -784,15 +784,15 @@ static void graph_vis(t_gobj *gr, t_glist *parent_glist, int vis)
{
if (vis && gobj_shouldvis(gr, parent_glist))
{
sys_vgui("catch {.x%lx.c create polygon\
%d %d %d %d %d %d %d %d %d %d -tags %s -fill $graph_outline}\n",
sys_vgui(".x%lx.c create polygon\
%d %d %d %d %d %d %d %d %d %d -tags %s -fill $graph_outline\n",
glist_getcanvas(x->gl_owner),
//parent_glist,
x1, y1, x1, y2, x2, y2, x2, y1, x1, y1, tag);
}
else if (gobj_shouldvis(gr, parent_glist))
{
sys_vgui("catch {.x%lx.c delete %s}\n",
sys_vgui(".x%lx.c delete %s\n",
glist_getcanvas(x->gl_owner), tag);
//parent_glist, tag);
}
......
......@@ -355,7 +355,7 @@ static void my_numbox_draw_config(t_my_numbox* x,t_glist* glist)
*/
if (x->x_gui.x_fsf.x_selected) {
sys_vgui("catch { .x%lx.c itemconfigure %lxLABEL -font {{%s} -%d %s} -fill $select_color -text {%s} \n .x%lx.c itemconfigure %lxNUMBER -font {{%s} -%d %s} -fill $select_color \n .x%lx.c itemconfigure %lxBASE2 -fill $select_color };\n",
sys_vgui(" .x%lx.c itemconfigure %lxLABEL -font {{%s} -%d %s} -fill $select_color -text {%s} \n .x%lx.c itemconfigure %lxNUMBER -font {{%s} -%d %s} -fill $select_color \n .x%lx.c itemconfigure %lxBASE2 -fill $select_color\n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
......@@ -368,7 +368,7 @@ static void my_numbox_draw_config(t_my_numbox* x,t_glist* glist)
*/
}
else {
sys_vgui("catch { .x%lx.c itemconfigure %lxLABEL -font {{%s} -%d %s} -fill #%6.6x -text {%s} \n .x%lx.c itemconfigure %lxNUMBER -font {{%s} -%d %s} -fill #%6.6x \n .x%lx.c itemconfigure %lxBASE2 -fill #%6.6x };\n",
sys_vgui(".x%lx.c itemconfigure %lxLABEL -font {{%s} -%d %s} -fill #%6.6x -text {%s} \n .x%lx.c itemconfigure %lxNUMBER -font {{%s} -%d %s} -fill #%6.6x \n .x%lx.c itemconfigure %lxBASE2 -fill #%6.6x\n",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
x->x_gui.x_lcol, strcmp(x->x_gui.x_lab->s_name, "empty")?x->x_gui.x_lab->s_name:"",
canvas, x, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight,
......@@ -379,7 +379,7 @@ static void my_numbox_draw_config(t_my_numbox* x,t_glist* glist)
sys_vgui(".x%lx.c itemconfigure %lxBASE2 -fill #%6.6x\n", canvas,
x, x->x_gui.x_fcol);*/
}
sys_vgui("catch {.x%lx.c itemconfigure %lxBASE1 -fill #%6.6x };\n", canvas,
sys_vgui(".x%lx.c itemconfigure %lxBASE1 -fill #%6.6x;\n", canvas,
x, x->x_gui.x_bcol);
}
......@@ -446,9 +446,9 @@ static void my_numbox_draw_select(t_my_numbox *x, t_glist *glist)
// if so, disable highlighting
if (x->x_gui.x_glist == glist_getcanvas(glist)) {
sys_vgui("catch { .x%lx.c itemconfigure %lxBASE1 -outline $select_color };\n",
sys_vgui(".x%lx.c itemconfigure %lxBASE1 -outline $select_color\n",
canvas, x);
sys_vgui("catch { .x%lx.c itemconfigure %lxBASE2 -fill $select_color };\n",
sys_vgui(".x%lx.c itemconfigure %lxBASE2 -fill $select_color\n",
canvas, x);
sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill $select_color\n",
canvas, x);
......@@ -499,9 +499,9 @@ static void my_numbox_draw_select(t_my_numbox *x, t_glist *glist)
else
{
sys_vgui(".x%lx.c dtag %lxNUM selected\n", canvas, x);
sys_vgui("catch { .x%lx.c itemconfigure %lxBASE1 -outline #%6.6x };\n",
sys_vgui(".x%lx.c itemconfigure %lxBASE1 -outline #%6.6x\n",
canvas, x, IEM_GUI_COLOR_NORMAL);
sys_vgui("catch {.x%lx.c itemconfigure %lxBASE2 -fill #%6.6x };\n",
sys_vgui(".x%lx.c itemconfigure %lxBASE2 -fill #%6.6x\n",
canvas, x, x->x_gui.x_fcol);
sys_vgui(".x%lx.c itemconfigure %lxLABEL -fill #%6.6x\n",
canvas, x, x->x_gui.x_lcol);
......
......@@ -1304,7 +1304,7 @@ static void text_select(t_gobj *z, t_glist *glist, int state)
sys_vgui(".x%lx.c itemconfigure %sR -outline %s\n", glist_getcanvas(glist),
rtext_gettag(y), (state? "$select_color" : outline));
if (z->g_pd == gatom_class) {
sys_vgui("catch {.x%lx.c itemconfigure %lx.l -fill %s}\n", glist_getcanvas(glist),
sys_vgui(".x%lx.c itemconfigure %lx.l -fill %s\n", glist_getcanvas(glist),
x, (state? "$select_color" : "$text_color"));
}
}
......
......@@ -555,7 +555,9 @@ static int pdCmd(ClientData cd, Tcl_Interp *interp, int argc, char **argv)
void tcl_mess(char *s)
{
int result;
Tcl_Obj *messageObjPtr = Tcl_NewStringObj(s,-1);
char catch_s[strlen(s)+10];
sprintf(catch_s, "catch { %s }", s);
Tcl_Obj *messageObjPtr = Tcl_NewStringObj(catch_s,-1);
Tcl_IncrRefCount(messageObjPtr);
result = Tcl_EvalObjEx(tk_pdinterp, messageObjPtr, TCL_EVAL_GLOBAL);
Tcl_DecrRefCount(messageObjPtr);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment