On Tue, May 30, 2006 at 07:35:39PM +0100, Gustavo J. A. M. Carneiro wrote: >On Ter, 2006-05-30 at 08:26 +0100, Magnus Therning wrote: [..] >> I have two questions: >> 1. What's the difference between enum and flags for pygtk-codegen, and >> when should I use which? > > enums are mutually exclusive values; flags are values that can be >combined in a single 'set' value, like bit masks.
Ah, that clears things up. Thanks. >> 2. How do i derive the gtype-id? (I seem to have done it right for >> WnckWindowGravity but not for WnckWindowMoveResizeMask.) > > gtype-id is guessed by h2def.py, but most libraries out there are not >bindings-friendly and don't bother to register GType's for enums and >flags. Metacity is one of those. My advice is, simply remove the >gtype-id, so pygtk-codegen will simply generate code to register the >values as simple int constants. Oh, OK. I got the impression that libwnck does the right thing since all the enums/flags in wnck.defs does have gtype-ids... it might be my inexperience with GTK+/GNOME that's shining through though :-) On to the next problem then (which I sent in another email as well), where do enums/flags live in the python bindings? I need to instantiate and pass some flags into a libwnck function. /M -- Magnus Therning (OpenPGP: 0xAB4DFBA4) [EMAIL PROTECTED] Jabber: [EMAIL PROTECTED] http://therning.org/magnus Software is not manufactured, it is something you write and publish. Keep Europe free from software patents, we do not want censorship by patent law on written works. Good powers of observation are frequently called "cynicism" by those that don't have them.
pgpVd38Lh8A52.pgp
Description: PGP signature
_______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
