Re: libseed-list GTK+3 example?



I just updated seed from jhbuild.

when I run connected draw signal, it prints the following for the two
parameters:

[object GtkDrawingArea]
[object seed_struct]


The function is: 

function draw_arc( drawing_area, cr ){
	print(drawing_area);
	print(cr);
	return false;
}


Do I need to updae WebKit or GIR files somehow?


thanks - august.


> Gtk3 docs have been generated now, 
> 
> At the bottom of my rant about unity, there are some details on the major changes in Gtk3 that affect seed.
> http://roojs.com/index.php/View/236/.html
> 
> In this case,
> http://www.roojs.com/seed/gir-1.2-gtk-3.0/seed/Gtk.DrawingArea.html
> 
> The signal signature is this,
> draw (Widget self, Context cr) : gboolean
> function draw_arc(ctx,cr){
> 	print(cr); // should output [object CairoContext]
> }
> 
> 
> Regards
> Alan
>  --- On 18/May/2011, august wrote: 
> > Hi Everyone,
> > 
> > 	I'm struggling with a problem.  With GTK2, seed was able to draw in a
> > 	widget using the expose_event signal and a callback such as this:
> > 
> > 	function draw_arc(drawing_area){
> > 		    var cr = new cairo.Context.from_drawable(drawing_area.window);	
> > 			// .. do soem cairo stuff on cr
> > 			 return false;
> > 	}
> > 	var d = new Gtk.DrawingArea();
> > 	d.signal.expose_event.connect(draw_arc);
> > 
> > 
> > 	In GTK3, I see there is a "draw" signal that one can connect to.
> > 	However, instead of a Cairo.context as a parameter, I still get a
> > 	[object GtkDrawingArea].
> > 
> > 	function draw_arc(ctx){
> > 			print(ctx); // outputs [object GtkDrawingArea]
> > 	}
> > 	var d = new Gtk.DrawingArea();
> > 	d.signal.draw.connect(draw_arc);
> > 
> > 
> > 	Any ideas or suggestions here?  How do I get a Cario context in
> > 	GTK+-3?
> > 
> > 
> > 	Thanks -august.
> > 
> > _______________________________________________
> > libseed-list mailing list
> > libseed-list gnome org
> > http://mail.gnome.org/mailman/listinfo/libseed-list
> 
> _______________________________________________
> libseed-list mailing list
> libseed-list gnome org
> http://mail.gnome.org/mailman/listinfo/libseed-list

-- 
	-------------------
	http://aug.ment.org



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