Re: Newbie and drawing_area




On Tue, 4 Dec 2001, Clemens Kirchgatterer wrote:

Mariusz Bozewicz wrote:
Hello

I still have a problem with drawing area. I looked lissajoux's code.
My program is similar to lissajou, but something goes wrong.
Could you help me with my simple code (code is as attachment)?

it's not that easy. it took my some minutes to find the solution! ;-)
a fixed version of your program is attached ...

best regards ...
clemens

GtkWidget *area;


void line (gint x,gint y, gint x1,gint y1)
{
        gdk_draw_line(area->window,area->style->black_gc,x,y,x1,y1);
}
gint repaint(GtkWidget *w, gpointer d)
{
        line (10,10,300,50);
        return FALSE;
}



.....
gtk_signal_connect(GTK_OBJECT(area),"expose_event",
                        GTK_SIGNAL_FUNC(repaint),NULL);

....
So, if I want to draw directly into drawing area I should use
signal: expose_event. Am I right?
                        Mariusz Bozewicz




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