libglademm: on_realize signal doesn't seem to connect



Hi,

I've just stopped using glade-- in favour of libglademm.
I'm having a problem with DrawingArea though. Right now I'm just trying to connect the on_realize() signal, but it never gets called. I use the get_widget_derived.

From the code below, can someone tell me what I'm doing wrong? thanks


---- derivedDrawingArea.h ----
class DerivedDrawingArea : public Gtk::DrawingArea
{
public:
  DerivedDrawingArea(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
  virtual ~DerivedDrawingArea();


protected:
  //Signal handlers:
  virtual void on_drawingarea_realize();

  Glib::RefPtr<Gnome::Glade::Xml> m_refGlade;

};
---- derivedDrawingArea.cpp ----
DerivedDrawingArea::DerivedDrawingArea(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade)
: Gtk::DrawingArea(cobject),
  m_refGlade(refGlade)

{
  this->signal_realize().connect( sigc::mem_fun(*this, &DerivedDrawingArea::on_drawingarea_realize) );
}

DerivedDrawingArea::~DerivedDrawingArea()
{
}

void DerivedDrawingArea::on_drawingarea_realize()
{
    Gtk::DrawingArea::on_realize();
   
    std::cout << "realize" << std::endl;
}
---- main.cpp ----
  refXml->get_widget("window1", pWindow);
  if(pWindow)
  {
    DerivedDrawingArea* pDrawingArea = 0;
    refXml->get_widget_derived("drawingarea1", pDrawingArea);
    if (pDrawingArea) kit.run(*pWindow);
  }


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