Re: Derived widget in libglademm
- From: Murray Cumming <murrayc murrayc com>
- To: Philipp Klaus Krause <pkk spth de>
- Cc: gtkmm-list gnome org
- Subject: Re: Derived widget in libglademm
- Date: Sat, 01 Sep 2007 23:35:16 +0200
On Sat, 2007-09-01 at 18:04 +0200, Philipp Klaus Krause wrote:
> I want to use a widget called Display derived from Gtk::DrawingArea. It
> seems to be created but on_realize() is not called. I have used glade 3
> to create a .glade file. I glade I used a DrawingAre as placeholder for
> my widget (since in the "basic" libglademm example a GtkDialog is used
> as placeholder in the .glade file for the widget derived from Gtk::Dialog).
> I do not know if what I've done is correct for using a derived widget,
> since all examples I could find only dealt with top-level derived
> widgets, while mine is in a container inside another widget.
>
> main.c, ending of main function:
> >
> > Display *display = 0;
> > refXml->get_widget_derived("display", display);
> >
> > Gtk::Window* main_win = 0;
> > refXml->get_widget("main_window", main_win);
> >
> > if (main_win)
> > {
> > kit.run(*main_win);
> > }
> > return 0;
>
>
>
> display.h:
>
> > class Display : public Gtk::DrawingArea, public Gtk::GL::Widget<Display>
> > {
> > public:
> > Display(BaseObjectType *da, Glib::RefPtr<Gnome::Glade::Xml>& refGlade);
Can we see the implementation of the constructor. I wonder if it calls
the base constructor with the da parameter.
> > void on_realize(void);
> > };
>
>
>
> > from display.cc:
> > void Display::on_realize(void)
> > {
> > for(;;);
> > Gtk::DrawingArea::on_realize();
>
> Philipp
--
murrayc murrayc com
www.murrayc.com
www.openismus.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]