From VisualWorks®, 7.6 of February 1, 2008 on February 1, 2008 at 12:48:40 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.'] <name>WalkThru</name> <environment>Smalltalk</environment> <private>false</private> <imports> private Smalltalk.* </imports> <category>Tutorial-WalkThru</category> <attributes> <package>WalkThru</package> </attributes> <comment> WalkThru
Name space for RandomNumberPicker of the WalkThrough.
</comment> <class> <name>RandomNumberPicker</name> <environment>WalkThru</environment> <super>UI.ApplicationModel</super> <private>false</private> none seed currentRandomValue myRandom <imports></imports> <category>Tutorial-WalkThru</category> <attributes> <package>WalkThru</package> </attributes> </class> <comment> WalkThru.RandomNumberPicker
RandomNumberPicker is a UI for Random, which allows specifying a seed value, and then displays successive random values. Instance Variables: currentRandomValue <ValueModel> the current random number myRandom <Stream> an instance of Random seed <ValueModel> a seed value
</comment> <methods> WalkThru.RandomNumberPicker <category>aspects</category>
currentRandomValue "This method was generated by UIDefiner. Any edits made here may be lost whenever methods are automatically defined. The initialization provided below may have been preempted by an initialize method." ^currentRandomValue isNil ifTrue: [currentRandomValue := 0 asValue] ifFalse: [currentRandomValue]
seed "This method was generated by UIDefiner. Any edits made here may be lost whenever methods are automatically defined. The initialization provided below may have been preempted by an initialize method." ^seed isNil ifTrue: [seed := 0 asValue] ifFalse: [seed]
</methods> <methods> WalkThru.RandomNumberPicker <category>actions</category>
nextRandom "Update the current random display with the Next button is clicked" currentRandomValue value: myRandom next
resetSequence "Start a new Random, with a specified seed if seed is not 0" | seedValue | seedValue := seed value. seedValue = 0 ifTrue: [myRandom := Random new] ifFalse: [myRandom := Random new seed: seedValue]. currentRandomValue value: 0.
</methods> <methods> WalkThru.RandomNumberPicker <category>initialize-release</category>
initialize "Create the initial random number generator for this application" myRandom := Random new.
</methods> <methods> WalkThru.RandomNumberPicker class <category>interface specs</category>
windowSpec "UIPainter new openOnClass: self andSelector: #windowSpec" <resource: #canvas> ^#(#{UI.FullSpec} #window: #(#{UI.WindowSpec} #label: 'Random Number Picker' #bounds: #(#{Graphics.Rectangle} 40 308 240 508 ) ) #component: #(#{UI.SpecCollection} #collection: #( #(#{UI.InputFieldSpec} #layout: #(#{Graphics.Rectangle} 45 29 145 53 ) #model: #currentRandomValue #tabable: false #alignment: #right #isReadOnly: true #type: #number ) #(#{UI.InputFieldSpec} #layout: #(#{Graphics.Rectangle} 45 81 145 105 ) #model: #seed #alignment: #right #type: #number ) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.Rectangle} 26 143 77 168 ) #model: #nextRandom #label: 'Next' #defaultable: true ) #(#{UI.ActionButtonSpec} #layout: #(#{Graphics.Rectangle} 119 142 170 167 ) #model: #resetSequence #label: 'Reset' #defaultable: true ) #(#{UI.LabelSpec} #layout: #(#{Core.Point} 14 6 ) #label: 'Current Random Value' ) #(#{UI.LabelSpec} #layout: #(#{Core.Point} 16 60 ) #label: 'Seed' ) ) ) )
</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>