diff --git a/src/actions.c b/src/actions.c index bec5ce94..43f66d04 100644 --- a/src/actions.c +++ b/src/actions.c @@ -104,8 +104,12 @@ const char *get_text_floater(int i) if(xctx->text[i].floater_instname) instname = xctx->text[i].floater_instname; - else + else { instname = get_tok_value(xctx->text[i].prop_ptr, "name", 0); + if(!xctx->tok_size) { + instname = get_tok_value(xctx->text[i].prop_ptr, "floater", 0); + } + } inst = get_instance(instname); if(inst >= 0) { if(xctx->text[i].floater_ptr) { @@ -116,6 +120,13 @@ const char *get_text_floater(int i) txt_ptr = xctx->text[i].floater_ptr; } dbg(1, "floater: %s\n",txt_ptr); + } else { + /* do just a tcl substitution if floater does not reference an existing instance + * (but name=something attribute must be present) and text matches tcleval(...) */ + if(strstr(txt_ptr, "tcleval(") == txt_ptr) { + my_strdup(_ALLOC_ID_, &xctx->text[i].floater_ptr, tcl_hook2(xctx->text[i].txt_ptr)); + txt_ptr = xctx->text[i].floater_ptr; + } } } return txt_ptr; @@ -807,6 +818,7 @@ int set_text_flags(xText *t) str = get_tok_value(t->prop_ptr, "hide", 0); t->flags |= strcmp(str, "true") ? 0 : HIDE_TEXT; str = get_tok_value(t->prop_ptr, "name", 0); + if(!xctx->tok_size) str = get_tok_value(t->prop_ptr, "floater", 0); t->flags |= xctx->tok_size ? TEXT_FLOATER : 0; my_strdup2(_ALLOC_ID_, &t->floater_instname, str); } diff --git a/src/save.c b/src/save.c index 8a5da99c..0994c162 100644 --- a/src/save.c +++ b/src/save.c @@ -3569,6 +3569,10 @@ int load_sym_def(const char *name, FILE *embed_fd) is_floater = 0; get_tok_value(tmptext.prop_ptr, "name", 2); if(xctx->tok_size) is_floater = 1; /* get rid of floater texts in LCC symbols */ + else { + get_tok_value(tmptext.prop_ptr, "floater", 2); + if(xctx->tok_size) is_floater = 1; /* get rid of floater texts in LCC symbols */ + } if( !strcmp(get_tok_value(tmptext.prop_ptr, "symbol_ignore", 0), "true") || is_floater) { my_free(_ALLOC_ID_, &tmptext.prop_ptr); my_free(_ALLOC_ID_, &tmptext.txt_ptr);