I'm a bit wonder, why you sending a #buttonMorph to checkbox morph, trying to intercept a messages? As to me this is a wrong approach, because you as a user of checkbox, should not care about its internals, and speak directly with checkbox public layer , but not with its internal components.
2009/10/6 Cyrille Delaunay <[email protected]>: > here is the code of the method creating the checkboxes: > checkBoxes := OrderedCollection new. > builder := ExampleBuilderMorph new. > dialog := (builder newPluggableDialogWindow: 'Context to import :') > useDefaultOKButton . > dialog contentMorph: ( > dialog newRow: { > dialog newGroupboxForAll: > (self allContexts collect: [:each | (checkBoxes add: (dialog > newCheckboxFor: > (ValueHolder new > contents: (collectionWithItemsToCheck includes: each)) > getSelected: #contents > setSelected: #contents: > label: each asString > help: '') > ). > ]) > } > ); > model: nil. > checkBoxes do: [:each | each on: #click send: #updateDependenciesFor:i:a: > to: self withValue: each label asString]. > => That code make what I want when I click on the label, but with: > checkBoxes do: [:each | each buttonMorph on: #click send: > #updateDependenciesFor:i:a: to: self withValue: each label asString]. > => nothing happen when I click on the checkbox button. > > 2009/10/6 Stéphane Ducasse <[email protected]> >> >> can you send some text :) >> >> On Oct 6, 2009, at 2:02 PM, Cyrille Delaunay wrote: >> >> > I join a screenshot of my code. >> > >> > 2009/10/6 Stéphane Ducasse <[email protected]> >> > cyrille >> > >> > do you have a piece of code to illustrate your problem? >> > Let me rephrase our discussions: >> > >> > you can get the associated checkbox event (set by >> > on: #click send: #amessage to: receiver) raised only >> > when you click on the label but not on the tick. >> > >> > And that >> > checkbox buttonMorph on: #click send: #amessage to: receiver, >> > is not working on click >> > but checkbox buttonMorph on: #mouseDown send: #amessage to: >> > receiver, >> > is. >> > >> > >> > Stef >> > >> > >> > >> > On Oct 6, 2009, at 12:08 PM, Cyrille Delaunay wrote: >> > >> > > Hi, >> > > >> > > Here is what I want to do: >> > > >> > > - I have checkbox: ChekboxMorph new >> > > - A checkbox is made of a label and a button >> > > - I want to do a specific action when there is a mouse click on the >> > > button >> > > >> > > For that: >> > > >> > > - I saw that there is a method #on:send:to: in Morph with wich we >> > > can do: >> > > >> > > checkbox on: #click send: #amessage to: receiver >> > > >> > > Problem: >> > > >> > > - when I do >> > > checkbox on: #click send: #amessage to: receiver, >> > > all is ok. >> > > - when I do >> > > checkbox buttonMorph on: #click send: #amessage to: >> > receiver, >> > > to consider the click on the button, it doesn't work, the event is >> > > never handled (whereas #mouseDown for example is handled). >> > > >> > > >> > > _______________________________________________ >> > > Pharo-project mailing list >> > > [email protected] >> > > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > >> > >> > _______________________________________________ >> > Pharo-project mailing list >> > [email protected] >> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> > >> > <checkboxes.tiff>_______________________________________________ >> > Pharo-project mailing list >> > [email protected] >> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project >> >> >> _______________________________________________ >> Pharo-project mailing list >> [email protected] >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > > > _______________________________________________ > Pharo-project mailing list > [email protected] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > -- Best regards, Igor Stasenko AKA sig. _______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
