Re: goocanvas.Table: segfaults adding group
- From: Alessandro Dentella <sandro e-den it>
- To: goocanvas-list gnome org
- Subject: Re: goocanvas.Table: segfaults adding group
- Date: Mon, 14 Sep 2009 23:51:09 +0200
I installed goocanvas 0.12 so that at least it doesn't segfaults anymore.
The behaviour that I get when I add groups to the table is that they are not
laid down in they're respective position but they all want to stay in the
first row/col.
The followint python code demostrates what I mean: the second group overlaps
the first one and no spaces is left between the columns.
Am I doing something wrong?
TIA
sandro
*:-)
################################################
import gtk
import goocanvas
def create_group (table, row, column, text, width=None, color=None):
gr = goocanvas.Group(parent=table)
item = goocanvas.Rect (parent = gr,
width = width or 38,
height = 19,
fill_color = color)
text = goocanvas.Text(text=text, parent=gr)
table.set_child_properties (gr,
row = row,
column = column,)
def create_table (parent, rect=True):
table = goocanvas.Table (parent = parent, column_spacing = 10.0)
create_group (table, 0, 0, "(0,0)", width=100, color='red')
create_group (table, 0, 1, "(1,0)", color='green')
return table
window = gtk.Window (gtk.WINDOW_TOPLEVEL)
window.set_default_size (640, 600)
window.connect ("delete_event", gtk.main_quit)
window.realize()
canvas = goocanvas.Canvas ()
canvas.set_bounds (0, 0, 600, 450)
window.add (canvas)
root = canvas.get_root_item ()
table = create_table (root)
window.show_all()
try:
gtk.main ()
except KeyboardInterrupt:
pass
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]