# Gtk::Table

**URL:** <https://www.ruby-forum.com/t/gtk-table/106526>\
**Category:** Ruby-Gnome 2\
**Created:** [June 11, 2007, 5:26pm UTC](https://www.ruby-forum.com/t/gtk-table/106526 "2007-06-11T17:26:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Richard\_Midwinter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bc8723/32.png) [@Richard\_Midwinter](https://www.ruby-forum.com/u/Richard_Midwinter)\
**Post date:** [June 11, 2007, 5:26pm UTC](https://www.ruby-forum.com/t/gtk-table/106526/1 "2007-06-11T17:26:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Richard\_Midwinter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bc8723/32.png) [@Richard\_Midwinter](https://www.ruby-forum.com/u/Richard_Midwinter)\
**Post date:** [June 11, 2007, 5:40pm UTC](https://www.ruby-forum.com/t/gtk-table/106526/2 "2007-06-11T17:40:42Z")

</div>

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](http://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/](http://sourceforge.net/powerbar/db2/)

---

<div class="post-metadata">

**Author:** ![Richard\_Midwinter](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/bc8723/32.png) [@Richard\_Midwinter](https://www.ruby-forum.com/u/Richard_Midwinter)\
**Post date:** [June 11, 2007, 5:49pm UTC](https://www.ruby-forum.com/t/gtk-table/106526/3 "2007-06-11T17:49:54Z")

</div>

Peter J. wrote:

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

Spot on, thanks Pete.
