Set constraints for the added items

This commit is contained in:
Marco Pesenti Gritti 2006-09-13 14:11:12 +02:00
parent 016891ec9a
commit a1d629b6cd

View File

@ -22,6 +22,7 @@ def _new_icon_clicked_cb(icon):
def _icon_clicked_cb(icon): def _icon_clicked_cb(icon):
icon = IconItem(color=IconColor(), icon_name='activity-groupchat') icon = IconItem(color=IconColor(), icon_name='activity-groupchat')
icon.connect('clicked', _new_icon_clicked_cb) icon.connect('clicked', _new_icon_clicked_cb)
box.set_constraints(icon, 3, 3)
box.add_child(icon, 0) box.add_child(icon, 0)
model = goocanvas.CanvasModelSimple() model = goocanvas.CanvasModelSimple()
@ -30,20 +31,20 @@ root = model.get_root_item()
grid = Grid() grid = Grid()
box = CanvasBox(grid, CanvasBox.HORIZONTAL, 1) box = CanvasBox(grid, CanvasBox.HORIZONTAL, 1)
grid.set_constraints(box, 5, 5) grid.set_constraints(box, 3, 3)
root.add_child(box) root.add_child(box)
rect = goocanvas.Rect(fill_color='red') rect = goocanvas.Rect(fill_color='red')
box.set_constraints(rect, 5, 5) box.set_constraints(rect, 3, 3)
box.add_child(rect) box.add_child(rect)
icon = IconItem(color=IconColor(), icon_name='activity-web') icon = IconItem(color=IconColor(), icon_name='activity-web')
icon.connect('clicked', _icon_clicked_cb) icon.connect('clicked', _icon_clicked_cb)
box.set_constraints(icon, 5, 5) box.set_constraints(icon, 3, 3)
box.add_child(icon) box.add_child(icon)
icon = IconItem(color=IconColor(), icon_name='activity-groupchat') icon = IconItem(color=IconColor(), icon_name='activity-groupchat')
box.set_constraints(icon, 5, 5) box.set_constraints(icon, 3, 3)
box.add_child(icon) box.add_child(icon)
window = gtk.Window() window = gtk.Window()