Re: libseed-list GooCanvas bindings



I think a new canvas automatically creates a canvasgroup for the root-item, which can be retrieved with canvas.get_root_item(). So this is where all other items should be attached, that's why I set parent=root for the rect item.

alsaf wrote:
Hi Jonatan

If it's like GTK, wouldn't the rect be attached to the canvas instead of
the other way round?
I've had a quick google and amended the code and it was displayed
something (sorry, I've never used gooCanvas before and new to Seed
myself so not sure if this is what you should you require)
var goo = imports.gi.GooCanvas;
  var gtk = imports.gi.Gtk;
  gtk.init(0,0);

  var w = new gtk.Window();
  var canvas = new goo.Canvas();
  w.add(canvas);
  canvas.set_bounds(0,0,1000,1000);
  canvas.set_size_request(500,500);
	root = canvas.get_root_item();

 var rect = new goo.CanvasRect({
    parent:root,
    x:10,y:10,
    width:100,height:100,
    line_width:5,
    stroke_color:"blue"
  });

  canvas.set_root_item(rect)

  w.show_all();
  gtk.main();

_______________________________________________
libseed-list mailing list
libseed-list gnome org
http://mail.gnome.org/mailman/listinfo/libseed-list



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