Re: [glade--] Learning to use glademm-generated code

Christof Petig <[email protected]> Fri, 10 Dec 2004 22:28:06 +0100
Newsgroups gmane.comp.gnome.glademm
Organization Adolf Petig GmbH & Co. KG
Message-ID <[email protected]>
J. Baltasar GarcĂ­a Perez-Schofield schrieb:
> 	Well, actually, the devel version of gtkmm1.2 was installed. Anyway, I 
> upgraded my packages to version 2.4, so now:

there lie worlds between 1.2 and 2.4!

> libgtkmm2.4_1-2.4.7-1mdk
> libgtkmm2.4_1-devel-2.4.7-1mdk

(see below, my version is)
$ pkg-config --modversion gtkmm-2.4
2.4.8

> config.status: creating Makefile
> config.status: creating src/Makefile
> config.status: creating config.h
> config.status: error: cannot find input file: config.h.in

Hmmm. Autotools greatly vary. Can you try the CVS version of glademm, I 
still have to release again ...

> 	However, this time I was able to type "make" and have something executing. 
> Unfortunately, g++ reports errors in the source code:
> 
> window1_glade.cc: In constructor `window1_glade::window1_glade()':
> window1_glade.cc:40: error: 'class Gtk::Entry' has no member named 
> 'set_has_frame'

These methods exist in my installation of gtkmm, which version do you 
use, which version does glademm target?

$ fgrep set_has_frame /usr/include/gtkmm-2.4/gtkmm/*.h
/usr/include/gtkmm-2.4/gtkmm/entry.h:  void set_has_frame(bool setting = 
true);

> This happens in the constructor of the window. I simply removed the offending 
> code and everything worked just fine, and I was able to compile and execute 
> my first glade application (apart from the signal "hide" for the window, 
> where I put "exit(0)", intending to have the application finished when the 
> window is closed).

Gtk::Main::instance()->quit() is preferred (see gtkmm documentation) 
since it does not bypass local object destruction.

> I don't understand how gtkmm works when there are older files. New files with 
> a subfix "_new" are created, and it seems that the compilation goes through 
> these new files, but it doesn't compile well. It complained about new signal 
> handlers becoming the class abstract (?).

These files are created as a guideline. Glademm will (by design) not 
touch your program files. Please add the signal handler methods at the 
correct places (copy & paste usually is all you need).

The benefit is: You have the control how you subclass and structure your 
classes [while not every part of MAGuS (see below) is best choice it 
exercises a pretty complex OO model]

> Does this code compile with mingw (and the appropriate libraries) in windows ?

of course, see e.g. midgard.berlios.de for a huge application.

    Christof

_______________________________________________
glademm-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/glademm-list
signature.asc (application/pgp-signature, 251 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Debian - http://enigmail.mozdev.org

iD8DBQFBuhTpng+R+0ucfO0RAolfAJ42AhBySBmcZ0pu5W8kRlrYK2iZZgCgx2V2
FqF0fNCpcl+/ZYWPEaWBIsI=
=16tx
-----END PGP SIGNATURE-----