in reply to How to find the selected radio button in a Loft GUI

Show us some code. Read I know what I mean. Why don't you? first.


DWIM is Perl's answer to Gödel
  • Comment on Re: How to find the selected radio button in a Loft GUI

Replies are listed 'Best First'.
Re^2: How to find the selected radio button in a Loft GUI
by briannz556 (Beadle) on Jun 13, 2007 at 23:42 UTC
    Yes, I could supply code but what I'm after is a snippet of an idea to follow. I was wondering if there was a way in perl to do something like: for (7..14) { if ($win-> rb{$_}-> Checked()) { ... indicate found and exit loop ... } } New to perl so not sure what to put for the test condition for the for loop. rb{$_) is just something to indicate my thoughts on what I want. Does that make sense? Cheers

      I'd either put the radio button objects into and array or hash then loop using either:

      for (7..14) { if ($buttons[$_]->Checked ()) { ... indicate found and exit loop ... } }

      or

      for my $key (keys %buttons) { if ($buttons{$key}->Checked ()) { ... indicate found and exit loop ... } }

      depending on what you are trying to achieve.


      DWIM is Perl's answer to Gödel