Re: Where do I find the constants?



On Mo, 2013-12-30 at 18:53 +0000, Christian Jaeger wrote:

To solve future cases, the question remains about how would I get to
know that 

        if ($dialog->run == Gtk::RESPONSE_ACCEPT)
        

should be


if ($dialog->run == "ok")

It should not.  It should be

  if ($dialog->run eq "accept")

The translation from C enumeration constants to strings is very regular,
and identical to what is done in all perl-Glib-based modules.  We have a
description for Gtk2 at

https://metacpan.org/pod/release/XAOC/Gtk2-1.249/lib/Gtk2/api.pod#Flags-and-Enums>

A port of that to Gtk3 or maybe Glib or Glib::Object::Introspection
would be valuable, I think.  Patches welcome.




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