[email protected] wrote:
> When a widget's label lies outside the widget, and the
> label is changed to a shorter label, redraw_label() does
> not clear out the excess text left over from the longer
> label
> 
> I've worked around this by calling redraw() on the
> parent window,

Your example below says "parent()", which is not necessarily the same as parent 
window == "window()". But I assume you know that ;-)

> but (1) this seems crude, (2) the parent
> window isn't always handy (will the parent group do it?  I don't
> know), and (3) I can't tell from the docs if this is supposed
> to work reliably.

I don't think that this is documented anywhere in this detail.

> [...]  My main question is whether or
> not there's a reliable way to accomplish what I want to do:  replace
> a label with a shorter one and have the old one go away.

Whether or not it's reliable ... that depends on what you call reliable.

IMHO parent()->redraw() will draw the entire parent group with all children. 
This will also draw the parent group's background. So far, so good, but if
(a) the parent group doesn't have a background (FL_FRAME_BOX or FL_NO_BOX), or
(b) the label overlaps the parent group's border(s), then this wouldn't work as 
expected. Is this "reliable" enough?

OTOH, if you call window()->redraw(), then this would reliably draw everything, 
but might flicker, if you don't use double buffering (Fl_Double_Window).

Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to