Gtk::Table

I’m trying to add some items to a Gtk::Table which has been created by
Glade, from code invoked on a button press.

The code runs without error but widgets aren’t added to the table, or if
they are they’re not visible or something. The following code is how
I’ve tried to add the widgets:

symbol_label = Gtk::Label.new.set_text(‘Test1’)
price_label = Gtk::Label.new.set_text(‘Test2’)
@glade.get_widget(“table1”).attach_defaults(symbol_label,0,1,0,1)
@glade.get_widget(“table1”).attach_defaults(price_label,1,2,0,1)

Anyone have any suggestions? Thanks.

On Mon, Jun 11, 2007 at 05:26:10PM +0200, Richard Midwinter wrote:

symbol_label = Gtk::Label.new.set_text(‘Test1’)
price_label = Gtk::Label.new.set_text(‘Test2’)
@glade.get_widget(“table1”).attach_defaults(symbol_label,0,1,0,1)
@glade.get_widget(“table1”).attach_defaults(price_label,1,2,0,1)

Anyone have any suggestions? Thanks.

You probably just need to explicitly show the two new labels:

symbol_label.show
price_label.show

-pete


This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

Peter J. wrote:

You probably just need to explicitly show the two new labels:

Spot on, thanks Pete.