Re: ENUM syntax
- From: Guillaume Cottenceau <gc mandrakesoft com>
- To: red criticalintegration com
- Cc: gtk-perl-list gnome org
- Subject: Re: ENUM syntax
- Date: 11 Dec 2002 11:30:46 +0100
red criticalintegration com writes:
Greetings,
I've noticed a change of style between Gtk.pm and Gtk2.pm in the
way that you are able to specify ENUMS. You can specify ENUMS in Gtk.pm
using the '-' notation (for want of a better description.
... and yes this is allowed in 'use 'strict''. :-)
Example:
my $window = new Gtk::Window(-toplevel); # Valid.
$table1->attach($window, 0, 1, 0, 1, [-fill,-expand], [-shrink], 1, 1); # Valid.
but...
my $window = new Gtk2::Window(-toplevel);# Invalid.
$table2->attach($window, 0, 1, 0, 1, [-fill,-expand], [-shrink], 1, 1); # Invalid.
On a side note - note that for "flags" you can :
$table2->attach($window, 0, 1, 0, 1, ['fill', 'expand'], 'shrink', 1, 1);
E.g. when a flags param has only one element, the scalar notation
is allowed.
Could I request we re-instate this notation please :-)
Well it needs additional code, and having too many ways to do the
same thing is mostly confusing for people who read code examples
and code excerpts.. that's why I didn't allow the '-something'
notation when I coded the enums/flags stuff.
--
Guillaume Cottenceau - http://people.mandrakesoft.com/~gc/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]