![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Menu
class by instantiating the following pattern inside the
definition of the createViews
method:
Menu new title: menu-naming string; owner: self; appendItem: item-naming string selector: #view-manager method name; appendItem: another item-naming string selector: #another view-manager method name; ...
view manager
method named by a
appendItem:selector:
message.
appendSubMenu:
method, rather than the appendItem:selector:
method:
Menu new title: menu-naming string; owner: self; appendSubMenu: (Menu new title: menu-naming string; owner: self; ...); appendSubMenu: (Menu new title: another menu-naming string; owner: self; ...); ...
createViews
method:
... the top pane menuWindow: (theMenuWindow := MenuWindow new). ... the menu window addMenu: a menu ...
(file-dialog variable := FileDialog new) fileSpec: file-specifying string; open.
FileDialog
instances answer a file name when sent the file
message if you have clicked the Open
button; such instances answer
nil
when sent the file
message if you have clicked
the cancel
button.
(file name := file-dialog variable file) notNil ifTrue: [appropriate action-specifying expressions].