From VisualWorks®, 7.6 of February 1, 2008 on February 1, 2008 at 12:48:38 pm (Dialog confirm: 'You are filing-in a Parcel source file!\\While this is possible it will not have\the same effect as loading the parcel.\None of the Parcel''s prerequisites will\be loaded and none of its load actions\will be performed.\\Are you sure you want to file-in?' withCRs) ifFalse: [self error: 'Parcel file-in abandoned. Choose terminate or close.'] <class> <name>ToolbarDemo</name> <environment>Examples</environment> <super>UI.ApplicationModel</super> <private>false</private> none text <imports></imports> <category>UIApplications-New</category> <attributes> <package>ToolbarDemo-Examples</package> </attributes> </class> <comment> Examples.ToolbarDemo
ToolbarDemo demonstrates adding a toolbar to a window, by specifying a menu in the Tool Bar field of the window's properties.
</comment> <methods> Examples.ToolbarDemo <category>actions</category>
smalltalkRun (self builder componentAt: #text) widget controller printIt
</methods> <methods> Examples.ToolbarDemo <category>aspects</category>
text text isNil ifTrue: [text := '"Select the expression below and press the ''Run'' button" 3+4' asValue]. ^text
</methods> <methods> Examples.ToolbarDemo class <category>resources</category>
menuBar "MenuEditor new openOnClass: self andSelector: #menuBar" <resource: #menu> ^#(#Menu #( #(#MenuItem #rawLabel: '&Smalltalk' #submenu: #(#Menu #( #(#MenuItem #rawLabel: '&Run' #value: #smalltalkRun ) #(#MenuItem #rawLabel: 'E&xit' #value: #closeRequest ) ) #(1 1 ) nil ) ) ) #(1 ) nil ) decodeAsLiteralArray
runIcon "UIMaskEditor new openOnClass: self andSelector: #runIcon" <resource: #image> ^CachedImage on: (Image extent: 16@16 depth: 1 bitsPerPixel: 1 palette: MonoMappedPalette blackWhite usingBits: #[254 63 0 0 252 31 0 0 252 31 0 0 252 63 0 0 254 127 0 0 224 31 0 0 240 3 0 0 248 99 0 0 252 127 0 0 238 127 0 0 196 15 0 0 128 15 0 0 216 207 0 0 253 207 0 0 255 195 0 0 255 195 0 0])
toolBar "MenuEditor new openOnClass: self andSelector: #toolBar" <resource: #menu> ^#(#{UI.Menu} #( #(#{UI.MenuItem} #rawLabel: '&Run' #value: #smalltalkRun #labelImage: #(#{UI.ResourceRetriever} #{Examples.ToolbarDemo} #runIcon ) ) ) #(1 ) nil ) decodeAsLiteralArray
</methods> <methods> Examples.ToolbarDemo class <category>interface specs</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: 'Unlabeled Canvas' #bounds: #(#{Graphics.Rectangle} 787 215 987 415 ) #flags: 4 #menu: #menuBar #toolBar: #toolBar #isEventDriven: true ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.TextEditorSpec} #layout: #(#{Graphics.LayoutFrame} 0 0 0 0 0 1 0 1 ) #name: #text #model: #text ) ) ) )
</methods> "Imported Classes:" self error: 'Attempting to file-in parcel imports. Choose terminate or close' <class> <name>ApplicationModel</name> <environment>UI</environment> <super>UI.Model</super> <private>false</private> none builder uiSession eventHandlers savedWindowInformation <imports></imports> <category>UIBuilder-Framework</category> <attributes> <package>UIBuilder-Framework</package> </attributes> </class>