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

On Wed, 2009-10-14 at 14:31 -0500, Steve Scott wrote:
> 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.

It should work, though you would see a warning on stderr if the
scrolledwindow already had a child widget (it may only contain one). A
simple test case might make things clearer.

I wonder if this has something to do with the Viewport that gtkmm's
ScrolledWindow::add() automatically adds to ScrolledWindows when needed
by the particular type of child widget. 

murrayc murrayc com

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