Re: force drawing area expose on button click



Scott Rubin <slr2777 cs rit edu> writes:

I think I may have done it wrong. To put it simply.  How can I force
the expose event to happen on the drawing_area widget whenever a
clicked event is signaled on one of my button widgets.  Thanks.

You should just queue a draw on the widget. Don't process_updates();
gtk+ will do that automatically in due course.

The standard way to do what you want is simply to

        g_signal_connect (G_OBJECT (button), "clicked",
                          G_CALLBACK (redraw), drawing_area);

with redraw() looking something like

        static void
        redraw (GtkWidget *button, 
                GtkWidget *drawing_area)
        {
                gtk_widget_queue_draw (drawing_area);
        }

Søren



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