Re: forcing immediate redraw on widget



Am Di, den 27.04.2004 schrieb Gus Koppel um 01:57:
Marc Santhoff wrote:

Your latest description sounds like a different problem than the one
I understood and tried to help you with. Am I right that your actual
problem isn't just to redraw the widget *immediately* but rather to
redraw the widget with a changed appearance *at all*? In this case
for a GtkHScale? So your problem is actually "how to change the
appearance of a GtkHScale" and not "how to immediately redraw a
widget"?

It is both:

Setting the bg color on the hscale does work, but the changed color
shows effect only after the value of the slider is changed by mouse or
keyboard. And it does change only at the area where the slider has
been resulting in sort of a dashed line.

In this situation i decided to force the redraw for circumventing this
behaviour.

So changing the attribute (BG colour) of the GtkHScale basically works
for you but your problem is still that it doesn't get completely redrawn
immediately? So your problem is simply that the lines

    gtk_widget_queue_draw (widget_to_redraw);
    while (gtk_events_pending ())
        gtk_main_iteration ();

have no effect at all for you? You know, you have to place those lines

Yes, exactly.

after(!) the location where you change the attributes of the widget,
i.e. your former code example!?

Sure, they follow directly after the changing code. :)

If this works on GtkHScales at all, i wonder why it doesn't for me. The
only thing to mention is that the function doing this is called from a
generic event handler (bound on both hscales at "event") for catching
special keystrokes (F5...F8). If a key is trapped the function returns
TRUE for signalling the event is handled, otherwise returning FALSE.

Any further ideas?

Marc





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]