libglademm: on_realize signal doesn't seem to connect

"Joost Ellerbroek" <[email protected]> Mon, 8 May 2006 15:34:35 +0200
Newsgroups gmane.comp.gnome.gnomemm
Message-ID <[email protected]>
--===============0710038126==
Content-Type: multipart/alternative; 
	boundary="----=_Part_84261_19454721.1147095275714"

------=_Part_84261_19454721.1147095275714
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

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 =3D 0;
    refXml->get_widget_derived("drawingarea1", pDrawingArea);
    if (pDrawingArea) kit.run(*pWindow);
  }

------=_Part_84261_19454721.1147095275714
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi,<br><br>I've just stopped using glade-- in favour of libglademm.<br>I'm =
having a problem with DrawingArea though. Right now I'm just trying to conn=
ect the on_realize() signal, but it never gets called. I use the get_widget=
_derived.
<br><br>From the code below, can someone tell me what I'm doing wrong? than=
ks<br><br><br>---- derivedDrawingArea.h ----<br>class DerivedDrawingArea : =
public Gtk::DrawingArea<br>{<br>public:<br>&nbsp; DerivedDrawingArea(BaseOb=
jectType* cobject, const Glib::RefPtr&lt;Gnome::Glade::Xml&gt;&amp; refGlad=
e);
<br>&nbsp; virtual ~DerivedDrawingArea();<br><br><br>protected:<br>&nbsp; /=
/Signal handlers:<br>&nbsp; virtual void on_drawingarea_realize();<br><br>&=
nbsp; Glib::RefPtr&lt;Gnome::Glade::Xml&gt; m_refGlade;<br><br>};<br>---- d=
erivedDrawingArea.cpp
 ----<br>DerivedDrawingArea::DerivedDrawingArea(BaseObjectType* cobject, co=
nst Glib::RefPtr&lt;Gnome::Glade::Xml&gt;&amp; refGlade)<br>: Gtk::DrawingA=
rea(cobject),<br>&nbsp; m_refGlade(refGlade)<br><br>{<br>&nbsp; this-&gt;si=
gnal_realize().connect( sigc::mem_fun(*this, &amp;DerivedDrawingArea::on_dr=
awingarea_realize) );
<br>}<br><br>DerivedDrawingArea::~DerivedDrawingArea()<br>{<br>}<br><br>voi=
d DerivedDrawingArea::on_drawingarea_realize()<br>{<br>&nbsp;&nbsp;&nbsp; G=
tk::DrawingArea::on_realize();<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;=
 std::cout &lt;&lt; &quot;realize&quot; &lt;&lt; std::endl;
<br>}<br>---- main.cpp ----<br>&nbsp; refXml-&gt;get_widget(&quot;window1&q=
uot;, pWindow);<br>&nbsp; if(pWindow)<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; Der=
ivedDrawingArea* pDrawingArea =3D 0;<br>&nbsp;&nbsp;&nbsp; refXml-&gt;get_w=
idget_derived(&quot;drawingarea1&quot;, pDrawingArea);
<br>&nbsp;&nbsp;&nbsp; if (pDrawingArea) kit.run(*pWindow);<br>&nbsp; }<br>

------=_Part_84261_19454721.1147095275714--

--===============0710038126==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
gnomemm-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnomemm-list

--===============0710038126==--