Al Koch wrote:
>> Right after you call labelcolor(), call redraw_label().  Should
>> do the trick.
>>
>> -Stan
>>
> 
> Hi Stan,
> 
> Thank you for your response.  Unfortunately redraw_label() hasn't fixed the 
> problem.  I have tried the following:
> 
> pWidget->redraw();
> 
> pWidget->redraw_label();
> 
> pWidget->redraw_label();
> pWidget->hide();
> pWidget->show();
> 
> pWidget->redraw_label();
> pWidget->parent()->redraw();
> 
> pWidget->resize(pWidget->x(),pWidget->y(),pWidget->w(),pWidget->h());
> 
> None of these will cause the button label to be refreshed.  But all I have to 
> do is drag another FLTK window over the button and then uncover it and the 
> label color changes!
> 
> Can you suggest something else to try?

        This sounds really strange.
        Are you sure the button is /inside/ the parent widgets, and
        not outside eg. a group?

        You can definitely have drawing problems if you have things
        like buttons positioned outside their parent groups' xywh area.

        Try telling the parent window to redraw.
        eg. pWidget->window()->redraw();
        That's excessive though, and shouldn't be needed.
        There's probably a problem somewhere else, either in your code,
        or in fltk.

        Do you have any custom draw() functions for any of the widgets
        in the hierarchy associated with the button in question?
        If so, do they call the base widget's draw() function? eg:

MyWidget::draw() {
    Group::draw();              // call base class's draw function first..
    // then do custom drawing here
}

        Even if your button is a regular FLTK button, if it's inside
        a custom widget that isn't drawing properly due to the
        draw() method's implementation, that could cause the problem.

        Are you able to demonstrate this problem with a small standalone
        program? If so, paste the complete compilable code for the
        standalone here. Strip out all unnecessary code, or write
        a small example program from scratch that has a similar
        widget hierarchy.

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

Reply via email to