I'm trying to add lines in a menu. The object I try to change is an Core.Array. And it's named groupSizes.
I'm trying to do like this:
((((UI.Menu current builder menuAt: #baseMenu) atNameKey: #menu6axisSpecialTool) submenu menuItems at: 5) submenu) groupSizes at: 1 put: #(4 1 9 4)
But that just puts a new array in side the array (logical). And "add:" don't work. I think I wish to achive something like this:
((((UI.Menu current builder menuAt: #baseMenu) atNameKey: #menu6axisSpecialTool) submenu menuItems at: 5) submenu) at: groupSizes put: #(4 1 9 4)
But that don't work either. I can inspect the object and manually change the array from (18) to my desired (4 1 9 4). To confim that the change will achive what I wish.
Oh, this will be a change that is applied to the image by fileIn from an external .st-file. Thats why I can't change how it's created, (that and the fact that I barely know what I'm doing.) and wish to manipulate the values inside the array.
I'm 100% green on smalltalk. So I attached a picture that might say more then my words.
Any idéas of how to change the value of that array?
On closer examination, this is more likely what i wish to do:
((((UI.Menu current builder menuAt: #baseMenu) atNameKey: #menu6axisSpecialTool) submenu menuItems at: 5) submenu) groupSizes at: 1 put: 4.
((((UI.Menu current builder menuAt: #baseMenu) atNameKey: #menu6axisSpecialTool) submenu menuItems at: 5) submenu) groupSizes at: 2 put: 1.
((((UI.Menu current builder menuAt: #baseMenu) atNameKey: #menu6axisSpecialTool) submenu menuItems at: 5) submenu) groupSizes at: 3 put: 9.
((((UI.Menu current builder menuAt: #baseMenu) atNameKey: #menu6axisSpecialTool) submenu menuItems at: 5) submenu) groupSizes at: 4 put: 4.
But the array don't have index 2-4, how can I increase the number of index:es?
In ArrayedCollection i found "growToAtLeast:" that could increase the capacity of groupSizes.
I'm not sure this is the correct way, and I also dont know why I increased the size to 2, to get 4 index. But it works. Pleace tell me if this is the wrong way.