Re: [Gnoga-list] Radio Buttons

2016-01-08 Thread Rabbi David Botton
>
> I presume one has to iterate over the buttons in a group, testing Checked,
> to
> find the currently checked button.
>
>
You could also set a value on each and use a single event handler that
updates a variable.

David Botton
--
___
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list


Re: [Gnoga-list] Radio Buttons

2016-01-08 Thread Rabbi David Botton
I updated the example in git to show using a single handler and value
(On_Change for radios is only called when a radio is selected not
deselected, which makes checking for Radio.Checked unnecessary):

   procedure Radio_Select (Element : in out Gnoga.Gui.Base.Base_Type'Class)
is
  Radio : Form.Radio_Button_Type renames Form.Radio_Button_Type
(Element);
   begin
  Gnoga.Log ("Radio Group #" & Radio.Value & " is now the checked
radio");
   end Radio_Select;

   for i in Radio_Group'Range loop
  Radio_Group (i).Create (F, Name => "Group1", Value => i'Img);
  Radio_Group (i).On_Change_Handler (Radio_Select'Unrestricted_Access);
  F.Put ("Radio Group #" & i'Img);
  F.New_Line;
   end loop;

On Fri, Jan 8, 2016 at 8:21 AM Rabbi David Botton  wrote:

> I presume one has to iterate over the buttons in a group, testing Checked,
>> to
>> find the currently checked button.
>>
>>
> You could also set a value on each and use a single event handler that
> updates a variable.
>
> David Botton
>
--
___
Gnoga-list mailing list
Gnoga-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gnoga-list