From: Jeroen v. d. Z. <jv...@cf...> - 2002-01-31 20:19:03
|
On Thursday 31 January 2002 14:07, you wrote: > Hi, > > I"m having a little trouble with the behavior of a set > of FXRadioButtons.. when I select one of the, all the > buttons get selected. the code relevant to the radio > buttons is below.. > > I'd appreciate it if someone could point out what I'm > doing wrong.. I looked at the datatarget example, but > I must be messing something up somewhere.. > > Thanks, > Michael > > ---snip---- > FXDataTarget *speedtarget; > FXint speedval; > speedtarget.connect(speedval); > speedtarget.setTarget(this); > speedtarget.setSelector(ID_SPEED); > > > //create the radio button frame > netSpeedFrame = new > FXHorizontalFrame(configdialog,LAYOUT_FILL_X, > 0,0,0,0,0,0,0,0); > netSpeedFrame->setBackColor(bgcolor); > netSpeedGroup = new > FXGroupBox(netSpeedFrame,"ConnectionSpeed",FRAME_GROOVE|LAYOUT_SIDE_TOP|LAY >OUT_FILL_X); > > // create a couple radio buttons > dslrb = new > FXRadioButton(netSpeedGroup,"DSL",&speedtarget, > ID_SPEED,LAYOUT_TOP|ICON_BEFORE_TEXT); > > cablerb->setBackColor(bgcolor); > netSpeedGroup,"LAN/T1/T3",&speedtarget,ID_SPEED,LAYOUT_TOP|ICON_BEFORE_TEXT >); I think your problem is using the ID_SPEED for message being sent from the FXRadioButton to the data target. The ID_SPEED message should only be used for the object receiving the messages FROM the data target. The messages that FXDataTarget understands are fixed, and in the case of connecting to FXRadioButton, the messages ID_OPTION+i should be used, where i is the value you want the varable speedval to assume (-10000<=i<=10000). Hope this helps, Jeroen |