Hi All
!
The little piece of
code below worked just fine for VW7.3.1.
Now I have made the
transition to VW7.4.1. The generated menu end up having all
labels correctly,
but as value always [ self setStartDirectory:
'UnixFileName('/')']
instead of having
the tree of directories available.
I assume there is
another method in the virtual machine to optimize code ?
buildSettingsMenu
| menu subMenu directory
|
menu := self builder menuAt: #menuBar.
subMenu := (menu
menuItemLabeled: 'Settings') submenu.
subMenu := (subMenu
menuItemLabeled: 'Start Directory') submenu.
subMenu menuItems do:
[:each | subMenu removeItem: each].
subMenu addItemLabel: 'select ...'
value: #selectStartDirectory.
directory := self directoryList list
first.
[directory ~= Filename separator asString] whileTrue:
[| newDir |
newDir := directory
asFilename head.
newDir ~= directory
ifTrue:
[subMenu
addItemLabel: directory value: [self setStartDirectory:
directory].
directory :=
newDir]
ifFalse: [directory := Filename separator
asString]]
________________________________________________________________
Karl-Albert Breith
AREVA NP GmbH
FEEC - G
Freyeslebenstrasse 1
91058 Erlangen
Phone: |
+49 (0) 9131
18-97393 |
Fax: |
+49 (0) 9131
18-94045 |