Derived widget in libglademm
- From: Philipp Klaus Krause <pkk spth de>
- To: gtkmm-list gnome org
- Subject: Derived widget in libglademm
- Date: Sat, 01 Sep 2007 18:04:39 +0200
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);
> void on_realize(void);
> };
> from display.cc:
> void Display::on_realize(void)
> {
> for(;;);
> Gtk::DrawingArea::on_realize();
Philipp
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]