tags:

views:

91

answers:

3

Hello, I am having a problem with widget Gtk.Table - I would like to know, if there is a way how to get a current size of the table (number of rows and columns).

Thank you, very much for help, Tomas

A: 

You should just be able to access the properties n-columns and n-rows.

You can do this using:

cols = mytable.get_property('n-columns')
rows = mytable.get_property('n-rows')
detly
A: 

You have to read GTK properties:

t = gtk.Table(myNumberOfRows, myNumberofCols)
t.get_property("n-rows") # number of rows in the table
t.get_property("n-columns") # number of cols in the table
tobiw
Thank you, guys
Tomas Novotny
A: 

In most recent versions of PyGTK you can get/set those values via table.props.n_columns and table.props.n_rows, which is synonymous with the get_property() (mentioned in the other answers) and set_property() methods.

Walter