Re: gtk priority constants



On Mon, 2007-12-31 at 08:44 +1100, Kevin Ryde wrote:
I wonder if the GTK_PRIORITY_RESIZE, GDK_PRIORITY_REDRAW and
GDK_PRIORITY_EVENTS constants could be offered within perl, perhaps per
below.  They can be good for putting idle or i/o stuff in at levels just
above or below what gtk will be doing (the redraw is the only one I've
got an immediate interest in :).

Yeah, having those constants would be good.  Unfortunately, our handling
of constants in Gtk2 is a mess.  Many constants aren't available at all,
some are wrapped as class methods (like Gtk2::Gdk->TARGET_STRING), some
as class functions (like Gtk2::Gdk::CHARS), and others have their own
small export-only module file (Gtk2/pm/Pango.pm aka. Gtk2::Pango).

So, one way to add new constants would be what you did: add them as
class functions to the respective namespace.  That doesn't make them
importable though.  For them to be importable, we'd have to add some
Exporter code like we have in Glib.  We'd also have to add another small
module file for the GDK_ constants in the Gtk2::Gdk namespace.

Another way might be to put all GTK_, GDK_, and PANGO_ constants we want
right into the Gtk2 namespace and make them importable from there.  The
attached patch is a stab at this approach.

So, what's the best way to make those constants available?  Where do
people look for them?

-- 
Bye,
-Torsten

Attachment: constants.patch
Description: Text Data



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]