Re: Using a glade file with a Gtk::Window-based class
- From: Michael <space3000 gmail com>
- To: gtkmm-list gnome org
- Subject: Re: Using a glade file with a Gtk::Window-based class
- Date: Sat, 19 Jun 2010 22:33:27 +0300
You need to use get_widget_derived.
More info here:
http://library.gnome.org/devel/gtkmm-tutorial/unstable/sec-builder-using-derived-widgets.html.en
On Sat, 2010-06-19 at 11:33 -0700, Political Confusion wrote:
> I'm using gtkmm 2.20.3 on Ubuntu 10.04. I have a simple GLADE file that works with the following code:
>
> Glib::RefPtr< Gtk::Builder > builder;
> builder = Gtk::Builder::create_from_file( UI_FILE );
> Gtk::Window* mainWindow = NULL;
> builder->get_widget( "mainWindow", mainWindow );
>
> After the get_widget call, mainWindow is a valid pointer. If I create a class:
>
> class MainWindow : public Gtk::Window {};
>
> and then try to use it:
>
> MainWindow* mainWindow = NULL;
> builder->get_widget( "mainWindow", mainWindow );
>
> mainWindow remains NULL. Is it possible to load a GLADE file into a derived window class?
>
> Thanks,
>
> Michael
>
>
>
>
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]