force redraw on hscale



Hi!

Trying once again in a new thread ...

Talking of GTK+ 1.2

Coming back on the beloved color topic:

There seems to be some sort of bug or misunderstanding by me. The actual
change in color happens delayed on a hscale I'm using and switching
color on.

If the color is changed, nothing is drawn changed. After the next change in
value at the gui, the background is changing from grey to green
(SPEED_COLOR_ACTIVE) exactly at the position the slider has been at.

My question: how can I force a redraw on selected widgets or the whole
window when needed?

TIA,
Marc

P.S.: some code:

var
        st      : pGtkRcStyle;
        cola, colp      : TGdkColor;
begin
...
                { swap the visual focus }
                gdk_color_parse(SPEED_COLOR_ACTIVE, @cola);
                gdk_color_parse(SPEED_COLOR_PASSIVE, @colp);

                st := gtk_rc_style_new ();
                
                if (target = 1) then begin
                        gtk_widget_grab_focus(GTK_WIDGET(scales[1]));
                        st^.bg[GTK_STATE_ACTIVE] := colp;
                        st^.color_flags[GTK_STATE_ACTIVE] := 
                                 st^.color_flags[GTK_STATE_ACTIVE] OR GTK_RC_BG;
                        gtk_widget_modify_style(GTK_WIDGET(scales[0]), st);
                        //gdk_flush(); no use ...




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