Re: various Gtk2 enumerations -- how to access?



the enum's actual values aren't available at the perl level, so if
you're wanting those for some reason you're probably out of luck. i
can't think of a situation where you'd really need them, but correct me
if you have found one.

you shouldn't need to create a perl object of the enum type. you should
just be able to have a perl scalar containing the one of the strings,
like you seemed to already have found out:

GtkShadowType
  GTK_SHADOW_NONE       => 'none'
  GTK_SHADOW_IN         => 'in'
  GTK_SHADOW_OUT        => 'out'
  GTK_SHADOW_ETCHED_IN  => 'etched-in'
  GTK_SHADOW_ETCHED_OUT => 'etched-out'

if you want GTK_SHADOW_IN then you'll do the following:
        $widget->takes_a_policy_type_enum('in');

if you're trying to test and see what value something has:
        if( $widget->returns_a_policy_type_enum eq 'in' )

if you're wanting to hold the type in a var then the following should
work:
        $shadow_type = 'in';
        $widget->takes_a_policy_type_enum($shadow_type);

if you're trying to do something beyond that then reply with more exact
details of what it is you're trying to do, a snippet of code would be
best.

-rm





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