Commit ab54e33d authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

Merge branch 'visual-feedback-when-clicking-on-empty-symbol-gatom'

parents ca0bd3a0 c33aace2
......@@ -1112,7 +1112,7 @@ static void gatom_key(void *z, t_floatarg f)
{
t_gatom *x = (t_gatom *)z;
int c = f;
//post("gatom_key <%c> %d", c, x->a_shift);
//post("gatom_key %f %d", f, x->a_shift);
int len = strlen(x->a_buf);
t_atom at;
char sbuf[ATOMBUFSIZE + 4];
......@@ -1139,7 +1139,11 @@ static void gatom_key(void *z, t_floatarg f)
else if (x->a_atom.a_type == A_SYMBOL)
{
//post("gatom_key release");
if (strcmp(x->a_buf, x->a_atom.a_w.w_symbol->s_name))
// ico@vt.edu 20200923: we also check for empty a_buf to ensure that
// the ... is deleted. This was created when the object was originally
// clicked on below, but only if the current gatom is symbol type and
// is empty.
if (x->a_buf[0] == 0 || strcmp(x->a_buf, x->a_atom.a_w.w_symbol->s_name))
{
strcpy(x->a_buf, x->a_atom.a_w.w_symbol->s_name);
gatom_retext(x, 1, 1);
......@@ -1256,6 +1260,16 @@ static void gatom_click(t_gatom *x,
return;
}
x->a_shift = shift;
if (x->a_atom.a_type == A_SYMBOL && !strlen(x->a_atom.a_w.w_symbol->s_name))
{
char sbuf[ATOMBUFSIZE + 4];
t_atom at;
sprintf(sbuf, "%s...", x->a_buf);
SETSYMBOL(&at, gensym(sbuf));
binbuf_clear(x->a_text.te_binbuf);
binbuf_add(x->a_text.te_binbuf, 1, &at);
glist_retext(x->a_glist, &x->a_text);
}
glist_grab(x->a_glist, &x->a_text.te_g, gatom_motion, gatom_key,
gatom_list, xpos, ypos);
//post("a_shift_clicked=%d", x->a_shift_clicked);
......
Markdown is supported
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