[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] MacPerl::Pick anomaly in 5.1.5r4



Consider:

$color = MacPerl::Pick("What's your favorite color baby?",
	"Red", "Green", "Gold");

print defined $color ? "Got a color of $color\n" : "User cancelled\n";

@colors = MacPerl::Pick("What're your favorite colors dude?",
	"Chartreuse", "Magenta", "Taupe");

print @colors ? "Got colors of " . join (', ', @colors) . "\n" :
	"User cancelled\n";

If you run this and double-click an item, the first works as expected--
the double-clicked item is returned. However, the second returns what
was selected before the item was double-clicked. So if you double-click
as soon as the dialog appears, an empty array is returned. If you select,
say, Magenta and Taupe, then double-click Chartreuse, ('Magenta', 'Taupe')
is returned.

Everything works correctly if you select some items then click OK (and is
a much appreciated enhancement--thanks Matthias).

Also, macperl.pod doesn't document the new behavior, it probably should.

Brian

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch