Re: flags object from strings



muppet <scott asofyet org> writes:

The big question is, what kind of syntax would you expect for this?

Perhaps a "new" method.

  my $f = Glib::ParamFlags->new (['readable']);

Some code below.  It runs, but dunno if I understand the subtleties of
classname to gtype conversion.  (Getting back G_TYPE_FLAGS depends on
your previously posted change too, otherwise Glib::Flags is
"unregistered".)

     my $num = 0;
...
     return bless \$num, $type;

That's what I broke out as a workaround starting object :-)

  my $empty_events = bless (do{my $zero=0; \$zero}, 'Gtk2::Gdk::EventMask');

-- 
"They say he carved it himself, from a bigger spoon."


Attachment: GType.xs.flags-new.diff
Description: Text Data

Attachment: t-flags.pl
Description: Text Data



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