Skip to content

Commit

Permalink
fix some sys_vgui remaining in g_text.c
Browse files Browse the repository at this point in the history
  • Loading branch information
sebshader committed Jun 15, 2024
1 parent 158a318 commit 29f4a05
Showing 1 changed file with 22 additions and 27 deletions.
49 changes: 22 additions & 27 deletions src/g_text.c
Original file line number Diff line number Diff line change
Expand Up @@ -800,13 +800,6 @@ static void gatom_list(t_gatom *x, t_symbol *s, int argc, t_atom *argv)
gatom_bang(x);
}

static void gatom_reborder(t_gatom *x)
{
t_rtext *y = glist_findrtext(x->a_glist, &x->a_text);
text_drawborder(&x->a_text, x->a_glist, rtext_gettag(y),
rtext_width(y), rtext_height(y), 0);
}

/* set border back to normal */
static void gatom_ungrab(t_gatom *x, t_rtext *y) {
t_canvas *c = glist_getcanvas(x->a_glist);
Expand Down Expand Up @@ -938,12 +931,15 @@ int rtext_findatomfor(t_rtext *x, int xpos, int ypos);
/* change to focused border */
static void gatom_clickborder(t_gatom *x) {
t_glist *glist = x->a_glist;
t_rtext *y = glist_findrtext(glist, &x->a_text);
sys_vgui(".x%lx.c itemconfigure %sR -width %d -outline "
"[::pdtk_canvas::get_color atom_box_focus_outline .x%lx]\n",
glist_getcanvas(glist), rtext_gettag(y),
glist->gl_zoom+glist->gl_zoom,
glist_getcanvas(glist));
t_glist *canvas_glist = glist_getcanvas(glist);
char buf[MAXPDSTRING];
sprintf(buf, "%sR", rtext_gettag(glist_findrtext(glist, &x->a_text)));
pdgui_vmess("pdtk_canvas::set_option_types",
"ci crs ri rr",
canvas_glist, 1, canvas_glist,
"itemconfigure",
buf, "-width", glist->gl_zoom+glist->gl_zoom,
"-outline", "atom_box_focus_outline");
}

/* this is called when gatom is clicked on with patch in run mode. */
Expand Down Expand Up @@ -1374,21 +1370,21 @@ static void text_select(t_gobj *z, t_glist *glist, int state)
"itemconfigure",
buf,
"-fill", (state? "selected" : "comment"));
else {
if (pd_class(&x->te_pd) == text_class)
outline = "obj_box_outline_broken";
else
switch (x->te_type) {
case T_MESSAGE: outline = "msg_box_outline"; break;
case T_ATOM: outline = "atom_box_outline"; break;
default: outline = "obj_box_outline";
}
else {
if (pd_class(&x->te_pd) == text_class)
outline = "obj_box_outline_broken";
else
switch (x->te_type) {
case T_MESSAGE: outline = "msg_box_outline"; break;
case T_ATOM: outline = "atom_box_outline"; break;
default: outline = "obj_box_outline";
}
pdgui_vmess("pdtk_canvas::set_option_types",
"ci crs rr",
glist, 1,
glist, "itemconfigure", buf,
"-outline", (state? "selected" : outline));
}
}
}
}

Expand Down Expand Up @@ -1605,10 +1601,9 @@ void glist_drawiofor(t_glist *glist, t_object *ob, int firsttime,
"-fill", (issignal ? "signal_iolet" : "msg_iolet"),
"-outline", (issignal ? "signal_iolet_border" : "msg_iolet_border"));
} else
sys_vgui(".x%lx.c coords %si%d %d %d %d %d\n",
c, tag, i,
onset, y1,
onset + iow, y1 + ih - glist->gl_zoom);
pdgui_vmess(0, "crs iiii",
glist_getcanvas(glist), "coords", tagbuf,
onset, y1, onset + iow, y1 + ih - glist->gl_zoom);
}
}

Expand Down

0 comments on commit 29f4a05

Please sign in to comment.