Le 24/03/2015 21:22, Alain Plantec via Pharo-users a écrit :
Have a look at the setting chapter (The Setting Framework)
Hi Alain, Thanks Alain. I was already studying the chapter yesterday, but it appears there is an unexpected complication, In a singleton DrGeoStylePreference class I define the methods as follow: drgeoStylesOn: aBuilder <drgeosettings> (aBuilder group: #drgeoStyle) label: 'Style'; with: [ (aBuilder group: #point) label: 'Point' translated; with: [ (aBuilder setting: #pointColor) label: 'Colour' translated]. ../.. then pointColor ^ current "respond the singleton, widget build up set later" settingInputWidgetForNode: aSettingDeclaration ^ (aSettingDeclaration name, 'Widget') asSymbol value: self. pointColorWidget ^ (UITheme builder newMorphDropListFor: self list: #colorMorphCollection getSelected: #pointColorIndex setSelected: #pointColorIndex: help: 'Set the colour.' translated) minWidth: DrGIcons menuExtent x + 35 ../.. and so on. The complication comes from the SettingDeclaration>>inputWidget where the widget model is set to the SettingDeclaration, and it breaks: inputWidget "return the default widget for the input a the setting" ../.. inputWidget ifNotNil: [(inputWidget respondsTo: #model:) ifTrue: [inputWidget model: self]]. ../.. If I remove the #model: call, it is ok. Did I miss something? Thanks Hilaire -- Dr. Geo - http://drgeo.eu iStoa - http://istoa.drgeo.eu