Re: cannot draw lines in a GtkDrawingArea widget



On Wed, Jun 21, 2006 at 08:29:23PM -0700, heavenscape wrote:
> 
> I need to draw some lines in a GtkDrawingArea widget, and I use the
> following code:
> 
> GtkWidget* w = lookup_widget(MainWnd,"drawingarea1"); 
> gdk_draw_line(w->window, //  a GdkDrawable - a GdkWindow
> 		w->style->fg_gc[GTK_WIDGET_STATE (w)],// a GdkGC.
> 		10,//the x coordinate of the start point
> 		30,//the y coordinate of the start point
> 		580,//the x coordinate of the end point
> 		30 //the y coordinate of the start point
> 		);
> 
> it does not work! Anybody knows why?

.From the use of lookup_widget() I assume you don't draw in
expose event handler (where you get the widget as function
argument and do not have to look it up).  Draw in the expose
handler -- can you see the lines now?

Yeti


--
Anonyms eat their boogers.



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