Rug Beport - Bug Fix / PluggableButtonView action:

John-Reed Maffeo (rlpa80) rlpa80 at email.sps.mot.com
Tue Jun 2 15:15:17 UTC 1998


I have found and fixed a small bug in Squeak.

FormMenuView was sending the message actionSelector:#turnOn
to an instance of PluggableButtonView, but PBV did not
understand.

Browsing through the protocol for PBV I found a method
that included action: but there was no seperate action:
method or actionSelector:.

I figured that the method for PBV should be action, so
I wrote one and made the changes to FormMenuView to
replace actionSelector: with action:.

If this is acceptable to Squeak Central, please add it to
the code base.

John-Reed Maffeo   Squeak Guru Wannabe (level 2?)









'From Squeak 2.0 of May 22, 1998 on 1 June 1998 at 9:58:53 pm'!

!FormMenuView methodsFor: 'private' stamp: 'jrm 6/1/1998 21:57'!
makeColorConnections: indexInterval

	| connector buttonCache button aSwitchView |
	connector _ Object new.  "a dummy model for connecting dependents"
	indexInterval do: [:index |
		buttonCache _ FormButtons at: index.
		buttonCache initialState = #true
			ifTrue: [button _ OneOnSwitch newOn]
			ifFalse: [button _ OneOnSwitch newOff].
		button onAction: [model changeTool: buttonCache value].
		button connection: connector.
		aSwitchView _ self makeViews: buttonCache for: button.
		aSwitchView
			borderWidthLeft: 1 right: 0 top: 1 bottom: 1;
			action: #turnOn].
	aSwitchView borderWidth: 1.
! !

!FormMenuView methodsFor: 'private' stamp: 'jrm 6/1/1998 21:56'!
makeConnections: indexInterval

	| connector buttonCache button aSwitchView |
	connector _ Object new.  "a dummy model for connecting dependents."
	indexInterval do: [:index |
		buttonCache _ FormButtons at: index.
		buttonCache initialState = #true
			ifTrue: [button _ OneOnSwitch newOn]
			ifFalse: [button _ OneOnSwitch newOff].
		button onAction: [model changeTool: buttonCache value].
		button connection: connector.
		aSwitchView _ self makeViews: buttonCache for: button.
		aSwitchView
			borderWidthLeft: 1 right: 0 top: 1 bottom: 1;
			action: #turnOn].
	aSwitchView borderWidth: 1.
! !


!PluggableButtonView methodsFor: 'accessing' stamp: 'jrm 6/1/1998 21:53'!
action: aSymbol 
	"Set actionSelector to be the action defined by aSymbol."

	actionSelector _ aSymbol
! !





More information about the Squeak-dev mailing list