Re: Derived widget in libglademm



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]