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> DerivedDrawingArea(BaseOb=
jectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlad=
e);
<br> virtual ~DerivedDrawingArea();<br><br><br>protected:<br> /=
/Signal handlers:<br> virtual void on_drawingarea_realize();<br><br>&=
nbsp; Glib::RefPtr<Gnome::Glade::Xml> m_refGlade;<br><br>};<br>---- d=
erivedDrawingArea.cpp
----<br>DerivedDrawingArea::DerivedDrawingArea(BaseObjectType* cobject, co=
nst Glib::RefPtr<Gnome::Glade::Xml>& refGlade)<br>: Gtk::DrawingA=
rea(cobject),<br> m_refGlade(refGlade)<br><br>{<br> this->si=
gnal_realize().connect( sigc::mem_fun(*this, &DerivedDrawingArea::on_dr=
awingarea_realize) );
<br>}<br><br>DerivedDrawingArea::~DerivedDrawingArea()<br>{<br>}<br><br>voi=
d DerivedDrawingArea::on_drawingarea_realize()<br>{<br> G=
tk::DrawingArea::on_realize();<br> <br> =
std::cout << "realize" << std::endl;
<br>}<br>---- main.cpp ----<br> refXml->get_widget("window1&q=
uot;, pWindow);<br> if(pWindow)<br> {<br> Der=
ivedDrawingArea* pDrawingArea =3D 0;<br> refXml->get_w=
idget_derived("drawingarea1", pDrawingArea);
<br> if (pDrawingArea) kit.run(*pWindow);<br> }<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==--