In my application, I have some radio buttons, which are always grouped
in groups of 2 or more. Recently I started getting some 'Recursion too deep' errors when I click on some of the radio buttons. For example: 'Recursion too deep; the stack overflowed. (16r3E9: Recursion too deep; the stack overflowed.)' ProcessorScheduler>>stackOverflow: [] in ProcessorScheduler>>vmi:list:no:with: BlockClosure>>ifCurtailed: ProcessorScheduler>>vmi:list:no:with: EventsCollection(SharedIdentityDictionary)>>hash:max: EventsCollection(SharedIdentityDictionary)>>findKeyOrNil: EventsCollection(LookupTable)>>at:ifAbsent: [] in EventsCollection(SharedLookupTable)>>at:ifAbsent: [] in Mutex>>critical: BlockClosure>>ifCurtailed: BlockClosure>>ensure: Mutex>>critical: EventsCollection(SharedLookupTable)>>at:ifAbsent: EventsCollection>>triggerEvent: MyModel(Object)>>trigger: MyModel>>myRadioButton: MyModel>>myRadioButton: MyModel>>myRadioButton: ...etc. Some of the radio buttons in my application produce this error when I click on them, while others do not. In the model, I implemented some logic so that when one radio button in the group is selected, it sets the others in the same group to false. For example, in one group, I have a pair of radio buttons called rb1 and rb2. In the model, I have two setter methods: rb1: aBoolean rb1 := aBoolean. self trigger: #rb1Changed. (aBoolean notNil and: [aBoolean]) ifTrue: [self rb2: false]. rb2: aBoolean rb2 := aBoolean. self trigger: #rb2Changed. (aBoolean notNil and: [aBoolean]) ifTrue: [self rb1: false]. I don't think this logic is causing the error, because when I click on a radio button that causes the error (and rb1 and rb2 do cause the error), and then click on another radio button in the same view (but in a different group of radio buttons) that does not cause the error, then clicking once again on the first radio button no longer causes the error! Can anyone suggest a cause of this 'Recursion too deep' error? Thanks. Ted Shen |
On 2 Nov 2004 12:57:36 -0800, Ted Shen <[hidden email]> wrote:
> rb1: aBoolean > rb1 := aBoolean. > self trigger: #rb1Changed. > (aBoolean notNil and: [aBoolean]) ifTrue: [self rb2: false]. > > rb2: aBoolean > rb2 := aBoolean. > self trigger: #rb2Changed. > (aBoolean notNil and: [aBoolean]) ifTrue: [self rb1: false]. > > I don't think this logic is causing the error, because when I click on > a radio button that causes the error (and rb1 and rb2 do cause the > error), and then click on another radio button in the same view (but > in a different group of radio buttons) that does not cause the error, > then clicking once again on the first radio button no longer causes > the error! > > Can anyone suggest a cause of this 'Recursion too deep' error? What do you do on #rb1Changed and #rb2Changed? -- Regards HweeBoon MotionObj |
In reply to this post by Ted Shen-3
Ted,
> In my application, I have some radio buttons, which are always grouped > in groups of 2 or more. Recently I started getting some 'Recursion > too deep' errors when I click on some of the radio buttons. For > example: [] > MyModel>>myRadioButton: > MyModel>>myRadioButton: > MyModel>>myRadioButton: > ...etc. I still think you will have to show us what's in the MyModel>>myRadioButton: method, and how the method is used, as that appears to be (from your truncated error dump) where the recursion is happening. > In the model, I implemented some logic so that when one radio button > in the group is selected, it sets the others in the same group to > false. For example, in one group, I have a pair of radio buttons > called rb1 and rb2. In the model, I have two setter methods: Can I ask why you feel the need to do this manually?. I think it's much easier and neater to let Windows automatically handle the selection/deselection of the buttons. All you have to do is use the VC to set the #isGroupStop aspect of the first button in a group (which much all be in one container) to true and the same aspect in the rest of the buttons to false. -- Ian Use the Reply-To address to contact me. Mail sent to the From address is ignored. |
I wrote:
> All you have to do is use the > VC to set the #isGroupStop aspect of the first button in a group > (which much all be in one container) to true and the same aspect in > the rest of the buttons to false. Can I just expand that a bit as it can get confusing. A demo.... Start up the VC and open up the Toolbox. DragDrop a Presenter.Container View onto the arena. DragDrop three BooleanPresenter.Radio buttons onto the container Running File/Test shows the three buttons are not acting as a radio button group and you are able to select all three at the same time. Go to the second and third RadioButtons and set the #isGroupStop aspect to false Running File/Test now shows all three buttons acting as a group, selecting one deselects the other. DragDrop three more BooleanPresenter.Radio buttons onto the container Set the new second and third buttons #isGroupStop aspect to false Running File/Test now shows that you have two _separate_ groups with the buttons whose #isGroupStop aspect is set to true defining the first button in the group. Does that explain things a bit better? -- Ian Use the Reply-To address to contact me. Mail sent to the From address is ignored. |
In reply to this post by Yar Hwee Boon-3
"Yar Hwee Boon" <[hidden email]> wrote in message news:<[hidden email]>...
> What do you do on #rb1Changed and #rb2Changed? I do not implement #rb1Changed or #rb2Changed. Ted |
Free forum by Nabble | Edit this page |