[lazarus] TRadioButtons

Michal Bukovjan bukovjan at mbox.dkm.cz
Sun Sep 8 17:01:57 EDT 2002


Barry Samuels wrote:

 >I sent the following to the list over an hour ago and the mailing
 >instructions say that the default is for me to receive a copy of my own
 >mail back. I haven't yet received my own mail back so I am assuming that
 >my mailing wasn't accepted because the address given was slightly
 >different from that which I used to subscribe. If this results in two
 >copies received on the list then I apologise.
 >
 >I have set up a form containing two TGroupBoxes each containing a group
 >of TRadioButtons.
 >
 >As I understand it the Radio Buttons in each GroupBox should be
 >independent of each other to the extent that selecting a Radio Button
 >in one GroupBox should not affect the status of Radio Buttons in the
 >other Group Box.
 >
 >However this is not the case as all Radio Buttons behave as if they
 >were in only one group. For example clicking a Radio Button in
 >GroupBox1 will unset any Radio Buttons in GroupBox2.
 >
 >I want, as previously mentioned, two independent groups. How can I
 >achieve this?
 >
 >All advice is appreciated.
 >
 >
Fixed in CVS. I greatly simplified the code, should be quite working now.
The only outstanding issue (documented in unit header) is with
reparenting, i.e. when parent is changed, it still acts as belonging
to the old group.

This one is very easy to fix (one has to hook to widget parent-set
signal of radio widget, and reset its group for new parent - code similar
to when widget is created, quite simple as GTK takes care about most of
the work), but I'll leave it as an excersice to reader - good starting
point to get yourself into Lazarus component programming for GTK interface!

Michal Bukovjan







More information about the Lazarus mailing list