Re: Glade, GTKMM, and adding widgets to containers that are created in Glade.

Thats what I tried before I used the derived widget option of Glade. As I wrote before:

m_refGlade->get_widget("myscrolledwindow", m_myScrolledWindow); // get my glade defined ScrolledWindow Widget from glade
m_myScrolledWindow->add(*m_myTreeView); // add my TreeView Widget to the scrolledWindow.  (and yes the Treeview has a listmodel)
m_myTreeView->show(); // update the GUI

For whatever reason my tree would never display.   Once I used a derived widget it worked.  So i ended up creating a derived ScrolledWindow in which I placed my tree into. 

I am with you.  I would have though either way would work, but it doesn't. Unless I am missing something.  ScrolledWindow does not have a pack_start.


On Wed, Oct 14, 2009 at 12:14 PM, Murray Cumming <murrayc murrayc com> wrote:
On Wed, 2009-10-14 at 06:47 -0500, Steve Scott wrote:
> I have used the derived widget for my main window, and that works
> fine, but is this the only way to add widgets to Glade containers?

You can add widgets to glade-instantiated containers just as you can add
them to containers instantiated in any other way. Just call the relevant
method, such as add(), pack_start(), etc. In practice, you will then
want to have a placeholder container in the Glade file into which you
will place your special widget.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]