[fpc-pascal]RE: force redraw on hscale
Marc Santhoff
M.Santhoff at t-online.de
Tue Apr 27 17:07:02 CEST 2004
Am Di, den 27.04.2004 schrieb Jeff Pohlmeyer um 07:58:
> > My question: how can I force a redraw on selected
> > widgets or the whole window when needed?
>
> Maybe this will help:
>
> procedure UpdateWidget(w:pGtkWidget);
> var
> update_rect: tGdkRectangle;
> begin
> update_rect.x:=0;
> update_rect.y:=0;
> update_rect.width:=w^.allocation.width;
> update_rect.height:=w^.allocation.height;
> gtk_widget_draw(w, @update_rect);
> end;
Hi Jeff!
I think it does work, but the color on the GtkHScale does not really
change, only after changing the value at the slider, as before.
I added (hint from the gtk mailing list) this:
gtk_widget_queue_draw(GTK_WIDGET(scales[0]));
while (gtk_events_pending()=gtk_true) do gtk_main_iteration ();
to process all pending draw event afterwards, but no luck. :(
Must be a bug or some plan I do not get.
Has anyone ever managed to change a GtkHScales color on the fly?
I can do it at startup from the ressource file, but changing afterwards
is not possible. But it does work when i minimize the window and restore
it! And it is colorizing the whole bar, not only the places where the
slider steps ...
Any further hints?
More information about the fpc-pascal
mailing list