View.st
author Claus Gittinger <cg@exept.de>
Fri, 15 Dec 1995 14:05:22 +0100
changeset 321 f31da2a1d387
parent 269 ea536bb319a6
child 616 56cf67c82664
permissions -rw-r--r--
interest is written with one 'r' (shame on me)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
48194c26a46c Initial revision
claus
parents:
diff changeset
     1
"
6
7ee0cfde237d *** empty log message ***
claus
parents: 5
diff changeset
     2
 COPYRIGHT (c) 1989 by Claus Gittinger
72
3e84121988c3 *** empty log message ***
claus
parents: 60
diff changeset
     3
	      All Rights Reserved
0
48194c26a46c Initial revision
claus
parents:
diff changeset
     4
48194c26a46c Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
48194c26a46c Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
48194c26a46c Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
48194c26a46c Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
48194c26a46c Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
48194c26a46c Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
48194c26a46c Initial revision
claus
parents:
diff changeset
    11
"
48194c26a46c Initial revision
claus
parents:
diff changeset
    12
135
claus
parents: 133
diff changeset
    13
SimpleView subclass:#View
claus
parents: 133
diff changeset
    14
	 instanceVariableNames:'model aspectMsg changeMsg menuMsg'
claus
parents: 133
diff changeset
    15
	 classVariableNames:''
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
    16
	 poolDictionaries:''
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
    17
	 category:'Views-Basic'
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    18
!
48194c26a46c Initial revision
claus
parents:
diff changeset
    19
2
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
    20
!View class methodsFor:'documentation'!
41
08a32edcaaa0 *** empty log message ***
claus
parents: 36
diff changeset
    21
46
7b331e9012fd *** empty log message ***
claus
parents: 42
diff changeset
    22
copyright
7b331e9012fd *** empty log message ***
claus
parents: 42
diff changeset
    23
"
7b331e9012fd *** empty log message ***
claus
parents: 42
diff changeset
    24
 COPYRIGHT (c) 1989 by Claus Gittinger
72
3e84121988c3 *** empty log message ***
claus
parents: 60
diff changeset
    25
	      All Rights Reserved
46
7b331e9012fd *** empty log message ***
claus
parents: 42
diff changeset
    26
7b331e9012fd *** empty log message ***
claus
parents: 42
diff changeset
    27
 This software is furnished under a license and may be used
7b331e9012fd *** empty log message ***
claus
parents: 42
diff changeset
    28
 only in accordance with the terms of that license and with the
7b331e9012fd *** empty log message ***
claus
parents: 42
diff changeset
    29
 inclusion of the above copyright notice.   This software may not
7b331e9012fd *** empty log message ***
claus
parents: 42
diff changeset
    30
 be provided or otherwise made available to, or used by, any
7b331e9012fd *** empty log message ***
claus
parents: 42
diff changeset
    31
 other person.  No title to or ownership of the software is
7b331e9012fd *** empty log message ***
claus
parents: 42
diff changeset
    32
 hereby transferred.
7b331e9012fd *** empty log message ***
claus
parents: 42
diff changeset
    33
"
7b331e9012fd *** empty log message ***
claus
parents: 42
diff changeset
    34
!
7b331e9012fd *** empty log message ***
claus
parents: 42
diff changeset
    35
41
08a32edcaaa0 *** empty log message ***
claus
parents: 36
diff changeset
    36
documentation
2
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
    37
"
135
claus
parents: 133
diff changeset
    38
    this class adds provisions for views which show or work on a model.
claus
parents: 133
diff changeset
    39
    This functionality used to be in View, but has been extracted into SimpleView and
claus
parents: 133
diff changeset
    40
    this new View class, to take some of the stuff out of views which do not need
claus
parents: 133
diff changeset
    41
    this functionality (i.e. all views which do only geometry management).
82
98a70bce6d51 *** empty log message ***
claus
parents: 81
diff changeset
    42
    Instances of View are seldom used, most views in the system inherit 
98a70bce6d51 *** empty log message ***
claus
parents: 81
diff changeset
    43
    from this class. 
41
08a32edcaaa0 *** empty log message ***
claus
parents: 36
diff changeset
    44
08a32edcaaa0 *** empty log message ***
claus
parents: 36
diff changeset
    45
    Instance variables:
08a32edcaaa0 *** empty log message ***
claus
parents: 36
diff changeset
    46
135
claus
parents: 133
diff changeset
    47
	model           <nil | any>         the model (if any)
140
claus
parents: 135
diff changeset
    48
135
claus
parents: 133
diff changeset
    49
	aspectMsg       <nil | Symbol>      the aspect; typically
claus
parents: 133
diff changeset
    50
					    dependentViews react on changes
claus
parents: 133
diff changeset
    51
					    of this aspect and update their contents.
140
claus
parents: 135
diff changeset
    52
135
claus
parents: 133
diff changeset
    53
	changeMsg       <nil | Symbol>      the changeMessage; typically
claus
parents: 133
diff changeset
    54
					    dependentViews send this message to
claus
parents: 133
diff changeset
    55
					    the model to tell it about changes.
140
claus
parents: 135
diff changeset
    56
135
claus
parents: 133
diff changeset
    57
	menuMsg         <nil | Symbol>      the menuMessage; typically
claus
parents: 133
diff changeset
    58
					    dependentViews send this message to
claus
parents: 133
diff changeset
    59
					    the model to ask for a popup menu.
140
claus
parents: 135
diff changeset
    60
					    Some classes allow setting an explicit
claus
parents: 135
diff changeset
    61
					    menuHolder and menuPerformer.
2
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
    62
"
b35336ab0de3 *** empty log message ***
claus
parents: 0
diff changeset
    63
! !
0
48194c26a46c Initial revision
claus
parents:
diff changeset
    64
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
    65
!View class methodsFor:'instance creation'!
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
    66
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    67
model:aModel
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    68
    "st-80 style view creation: create a new view and set its model"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    69
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    70
    ^ self new model:aModel
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    71
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
    72
140
claus
parents: 135
diff changeset
    73
on:aModel aspect:aspectMsg
claus
parents: 135
diff changeset
    74
    "st-80 style view creation: create a new view, set its model
claus
parents: 135
diff changeset
    75
     and selectors for aspect"
claus
parents: 135
diff changeset
    76
claus
parents: 135
diff changeset
    77
    ^ self new 
claus
parents: 135
diff changeset
    78
	on:aModel
claus
parents: 135
diff changeset
    79
	aspect:aspectMsg
claus
parents: 135
diff changeset
    80
!
claus
parents: 135
diff changeset
    81
claus
parents: 135
diff changeset
    82
on:aModel aspect:aspectMsg change:changeMsg
claus
parents: 135
diff changeset
    83
    "st-80 style view creation: create a new view, set its model
claus
parents: 135
diff changeset
    84
     and selectors for aspect and change"
claus
parents: 135
diff changeset
    85
claus
parents: 135
diff changeset
    86
    ^ self new 
claus
parents: 135
diff changeset
    87
	on:aModel
claus
parents: 135
diff changeset
    88
	aspect:aspectMsg
claus
parents: 135
diff changeset
    89
	change:changeMsg
claus
parents: 135
diff changeset
    90
!
claus
parents: 135
diff changeset
    91
135
claus
parents: 133
diff changeset
    92
on:aModel aspect:aspectMsg change:changeMsg menu:menuMsg
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
    93
    "st-80 style view creation: create a new view, set its model
140
claus
parents: 135
diff changeset
    94
     and selectors for aspect, change and menu"
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
    95
135
claus
parents: 133
diff changeset
    96
    ^ self new 
claus
parents: 133
diff changeset
    97
	on:aModel
claus
parents: 133
diff changeset
    98
	aspect:aspectMsg
claus
parents: 133
diff changeset
    99
	change:changeMsg
claus
parents: 133
diff changeset
   100
	menu:menuMsg
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   101
!
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   102
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   103
on:aModel aspect:aspectMsg menu:menuMsg
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   104
    "st-80 style view creation: create a new view, set its model
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   105
     and selectors for aspect and menu"
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   106
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   107
    ^ self new 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   108
	on:aModel
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   109
	aspect:aspectMsg
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   110
	menu:menuMsg
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   111
! !
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   112
123
9f8c7f20fdb2 *** empty log message ***
claus
parents: 121
diff changeset
   113
!View class methodsFor:'defaults'!
9f8c7f20fdb2 *** empty log message ***
claus
parents: 121
diff changeset
   114
140
claus
parents: 135
diff changeset
   115
defaultAspectMessage   
135
claus
parents: 133
diff changeset
   116
    "subclasses which by default do NOT want to be informed about changed
claus
parents: 133
diff changeset
   117
     models should redefine this to return nil"
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   118
135
claus
parents: 133
diff changeset
   119
    ^ #value
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   120
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   121
140
claus
parents: 135
diff changeset
   122
defaultChangeMessage   
135
claus
parents: 133
diff changeset
   123
    "subclasses which by default do NOT want to inform the model
claus
parents: 133
diff changeset
   124
     should redefine this to return nil"
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   125
135
claus
parents: 133
diff changeset
   126
    ^ #value:
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   127
! !
48194c26a46c Initial revision
claus
parents:
diff changeset
   128
170
claus
parents: 147
diff changeset
   129
!View methodsFor:'accessing-channels'!
claus
parents: 147
diff changeset
   130
claus
parents: 147
diff changeset
   131
setupChannel:newChannel for:changeSelector withOld:oldChannel
claus
parents: 147
diff changeset
   132
    "common code to change a channel"
claus
parents: 147
diff changeset
   133
claus
parents: 147
diff changeset
   134
    |oldValue|
claus
parents: 147
diff changeset
   135
claus
parents: 147
diff changeset
   136
    oldChannel notNil ifTrue:[
321
f31da2a1d387 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   137
	oldChannel retractInterestsFor:self.
170
claus
parents: 147
diff changeset
   138
	oldValue := oldChannel value.
claus
parents: 147
diff changeset
   139
    ].
claus
parents: 147
diff changeset
   140
    newChannel onChangeSend:changeSelector to:self.
claus
parents: 147
diff changeset
   141
    self perform:changeSelector.
claus
parents: 147
diff changeset
   142
    ^ newChannel
claus
parents: 147
diff changeset
   143
! !
claus
parents: 147
diff changeset
   144
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   145
!View methodsFor:'accessing-menus'!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   146
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   147
menuHolder
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   148
    "who has the menu ? 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   149
     By default, its the model if I have one."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   150
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   151
    model notNil ifTrue:[^ model].
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   152
    ^ self
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   153
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   154
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   155
menuPerformer
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   156
    "who should perform the menu actions ? 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   157
     By default, its the model if I have one."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   158
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   159
    model notNil ifTrue:[^ model].
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   160
    ^ self
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   161
! !
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   162
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   163
!View methodsFor:'accessing-mvc'!
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   164
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   165
addModelInterfaceTo:aDictionary
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   166
    "this adds entries for all messages sent to my model
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   167
     to aDictionary"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   168
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   169
    aDictionary at:#aspectMessage put:aspectMsg.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   170
    aDictionary at:#changeMessage put:changeMsg.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   171
    aDictionary at:#menuMessage put:menuMsg.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   172
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   173
    "
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   174
     Button new modelInterface 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   175
    "
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   176
!
135
claus
parents: 133
diff changeset
   177
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   178
aspect
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   179
    "Return the aspect used with changes from/to the model"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   180
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   181
    ^ aspectMsg
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   182
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   183
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   184
aspectMessage
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   185
    "Return the aspect used with changes from/to the model"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   186
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   187
    ^ aspectMsg
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   188
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   189
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   190
aspectMessage:aspectSymbol
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   191
    "ST-80 style updating: If a views aspectSymbol is nonNil, 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   192
     it will respond to changes of this aspect from the model."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   193
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   194
    aspectMsg := aspectSymbol
135
claus
parents: 133
diff changeset
   195
!
claus
parents: 133
diff changeset
   196
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   197
change:changeSymbol
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   198
    "ST-80 style change notification: If a views changeSymbol is nonNil, 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   199
     it will send it to its model when something changes.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   200
     Alias for changeMessage: for ST-80 compatibility."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   201
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   202
    self changeMessage:changeSymbol
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   203
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   204
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   205
changeMessage
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   206
    "Return the symbol sent to the model if nonNil when something changes."
135
claus
parents: 133
diff changeset
   207
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   208
    ^ changeMsg
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   209
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   210
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   211
changeMessage:aSymbol
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   212
    "ST-80 style change notification: If a views changeSymbol is nonNil, 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   213
     it will send it to its model when something changes.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   214
     This is the same as change: which was added for ST-80 compatibility."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   215
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   216
    changeMsg := aSymbol
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   217
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   218
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   219
controller:aController
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   220
    "set the controller"
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   221
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   222
    super controller:aController.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   223
    controller notNil ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   224
	controller model:model
0
48194c26a46c Initial revision
claus
parents:
diff changeset
   225
    ]
48194c26a46c Initial revision
claus
parents:
diff changeset
   226
!
48194c26a46c Initial revision
claus
parents:
diff changeset
   227
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   228
menu:menuSymbol
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   229
    "ST-80 style menus: If a views menuSymbol is nonNil, it
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   230
     will send it to its model when the middleButton is pressed.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   231
     That method should return nil or the menu to be shown.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   232
     This is useful for very dynamic menus, where it does not
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   233
     make sense to define an initial menu.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   234
     Alias for #menuMessage:, for ST-80 compatibility."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   235
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   236
    menuMsg := menuSymbol
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   237
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   238
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   239
menuMessage
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   240
    "Return the symbol sent to the model to aquire the menu"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   241
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   242
    ^ menuMsg
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   243
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   244
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   245
menuMessage:aSymbol
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   246
    "ST-80 style menus: If a views menuSymbol is nonNil, it
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   247
     will send it to its model when the middleButton is pressed.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   248
     That method should return nil or the menu to be shown.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   249
     This is useful for very dynamic menus, where it does not
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   250
     make sense to define an initial menu.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   251
     This is the same as #menu: which was added for ST-80 compatibility."
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   252
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   253
    menuMsg := aSymbol
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   254
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   255
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   256
model
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   257
    "return the model, for non-MVC views,
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   258
     this is nil or the receiver"
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   259
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   260
    ^ model
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   261
!
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   262
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   263
model:aModel
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   264
    "set the model"
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   265
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   266
    model notNil ifTrue:[
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   267
	model removeDependent:self
89
ea2bf46eb669 *** empty log message ***
claus
parents: 87
diff changeset
   268
    ].
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   269
    model := aModel.
135
claus
parents: 133
diff changeset
   270
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   271
    model notNil ifTrue:[
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   272
	aModel addDependent:self
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   273
    ].
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   274
    controller notNil ifTrue:[
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   275
	controller model:aModel
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   276
    ]
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   277
!
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   278
140
claus
parents: 135
diff changeset
   279
modelInterface
claus
parents: 135
diff changeset
   280
    "this returns a dictionary of messages sent to my model.
claus
parents: 135
diff changeset
   281
     It can be used for builders and wrappers to get information
claus
parents: 135
diff changeset
   282
     about the messages sent to my model.
claus
parents: 135
diff changeset
   283
     The returned dictionary contains one entry for each get-Msg,
claus
parents: 135
diff changeset
   284
     and the recevier will implement corresponding messages (with a colon)
claus
parents: 135
diff changeset
   285
     to set the message symbol."
claus
parents: 135
diff changeset
   286
claus
parents: 135
diff changeset
   287
    |d|
claus
parents: 135
diff changeset
   288
claus
parents: 135
diff changeset
   289
    d := IdentityDictionary new.
claus
parents: 135
diff changeset
   290
    self addModelInterfaceTo:d.
claus
parents: 135
diff changeset
   291
    ^ d
claus
parents: 135
diff changeset
   292
claus
parents: 135
diff changeset
   293
    "
claus
parents: 135
diff changeset
   294
     Button new modelInterface
claus
parents: 135
diff changeset
   295
     Label new modelInterface 
claus
parents: 135
diff changeset
   296
    "
claus
parents: 135
diff changeset
   297
claus
parents: 135
diff changeset
   298
    "
claus
parents: 135
diff changeset
   299
     does the view support setting the menuMessage ?
claus
parents: 135
diff changeset
   300
claus
parents: 135
diff changeset
   301
     SelectionInListView new modelInterface includesKey:#menuMessage 
claus
parents: 135
diff changeset
   302
    "
claus
parents: 135
diff changeset
   303
claus
parents: 135
diff changeset
   304
    "
claus
parents: 135
diff changeset
   305
     turn off all interaction to the model:
claus
parents: 135
diff changeset
   306
claus
parents: 135
diff changeset
   307
     |m v if|
claus
parents: 135
diff changeset
   308
claus
parents: 135
diff changeset
   309
     m := SelectionInList new.
claus
parents: 135
diff changeset
   310
     m list:#('one' 'two' 'tree' 'four') asValue.
claus
parents: 135
diff changeset
   311
     m selection:1 asValue.
claus
parents: 135
diff changeset
   312
     v := SelectionInListView on:m.
claus
parents: 135
diff changeset
   313
     v open.
claus
parents: 135
diff changeset
   314
     v inspect.
claus
parents: 135
diff changeset
   315
claus
parents: 135
diff changeset
   316
     if := v modelInterface.
claus
parents: 135
diff changeset
   317
     if inspect.
claus
parents: 135
diff changeset
   318
claus
parents: 135
diff changeset
   319
     if keysAndValuesDo:[:what :msg |
claus
parents: 135
diff changeset
   320
	 v perform:(what , ':') asSymbol with:nil.
claus
parents: 135
diff changeset
   321
     ].
claus
parents: 135
diff changeset
   322
    "
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   323
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   324
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   325
on:aModel aspect:aspectSymbol
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   326
    "ST-80 compatibility: set model and aspect
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   327
     messages - needs a view which uses these"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   328
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   329
    aspectMsg := aspectSymbol.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   330
    self model:aModel.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   331
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   332
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   333
on:aModel aspect:aspectSymbol change:changeSymbol
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   334
    "ST-80 compatibility: set model, aspect and change
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   335
     messages - needs a view which uses these"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   336
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   337
    aspectMsg := aspectSymbol.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   338
    changeMsg := changeSymbol.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   339
    self model:aModel.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   340
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   341
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   342
on:aModel aspect:aspectSymbol change:changeSymbol menu:menuSymbol
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   343
    "ST-80 compatibility: set model, aspect, change and menu
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   344
     messages - needs a view which uses these"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   345
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   346
    aspectMsg := aspectSymbol.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   347
    changeMsg := changeSymbol.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   348
    menuMsg := menuSymbol.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   349
    self model:aModel.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   350
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   351
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   352
on:aModel aspect:aspectSymbol menu:menuSymbol
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   353
    "ST-80 compatibility: set model, aspect and menu
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   354
     messages - needs a view which uses these"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   355
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   356
    aspectMsg := aspectSymbol.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   357
    menuMsg := menuSymbol.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   358
    self model:aModel.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   359
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   360
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   361
sendChangeMessage:aSelector with:arg
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   362
    "tell the model about a change"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   363
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   364
    |n selector|
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   365
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   366
    "/
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   367
    "/ MVC way of doing it:
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   368
    "/ if the model is a block, evaluate it, optionally
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   369
    "/ passing the arg and the receiver as arguments.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   370
    "/
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   371
    "/ otherwise (the common case) send it a changeMsg message
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   372
    "/ also with arg and the receiver (depending on the number of arguments
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   373
    "/ as defined by the selector).
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   374
    "/
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   375
    (model notNil and:[aSelector notNil]) ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   376
	n := aSelector numArgs.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   377
	model isBlock ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   378
	    n := model numArgs.
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   379
	    n == 0 ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   380
		selector := #value
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   381
	    ] ifFalse:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   382
		n == 1 ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   383
		    selector := #value:
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   384
		] ifFalse:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   385
		    selector := #value:value:
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   386
		]
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   387
	    ]
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   388
	] ifFalse:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   389
	    selector := aSelector
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   390
	].
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   391
	n == 0 ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   392
	    model perform:selector 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   393
	] ifFalse:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   394
	    n == 1 ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   395
		model perform:selector with:arg
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   396
	    ] ifFalse:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   397
		model perform:selector with:arg with:self 
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   398
	    ]
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   399
	]
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   400
    ]
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   401
!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   402
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   403
sendChangeMessageWith:arg
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   404
    "tell the model about a change"
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   405
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   406
    self sendChangeMessage:changeMsg with:arg
72
3e84121988c3 *** empty log message ***
claus
parents: 60
diff changeset
   407
! !
3e84121988c3 *** empty log message ***
claus
parents: 60
diff changeset
   408
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   409
!View methodsFor:'drawing'!
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   410
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   411
redraw
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   412
    "redraw myself
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   413
     if there is a model, this one shall redraw itself,
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   414
     otherwise we cannot do much here - has to be redefined in subclasses"
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   415
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   416
    model notNil ifTrue:[
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   417
	model update:self
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   418
    ]
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   419
! !
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   420
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   421
!View methodsFor:'initialization'!
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   422
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   423
initialize
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   424
    super initialize.
140
claus
parents: 135
diff changeset
   425
claus
parents: 135
diff changeset
   426
    aspectMsg := self class defaultAspectMessage.
claus
parents: 135
diff changeset
   427
    changeMsg := self class defaultChangeMessage.
claus
parents: 135
diff changeset
   428
135
claus
parents: 133
diff changeset
   429
    model notNil ifTrue:[
claus
parents: 133
diff changeset
   430
	controller notNil ifTrue:[
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   431
	    controller model:model
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   432
	]
81
4ba554473294 *** empty log message ***
claus
parents: 78
diff changeset
   433
    ].
118
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   434
! !
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   435
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   436
!View methodsFor:'realization'!
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   437
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   438
destroy
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   439
    "unrealize & destroy - make me invisible, destroy subviews then
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   440
     make me unknown to the device"
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   441
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   442
    model notNil ifTrue:[
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   443
	model removeDependent:self.
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   444
	model := nil.
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   445
    ].
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   446
    super destroy.
25e775072a89 *** empty log message ***
claus
parents: 116
diff changeset
   447
! !
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   448
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   449
!View class methodsFor:'documentation'!
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   450
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   451
version
321
f31da2a1d387 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 269
diff changeset
   452
    ^ '$Header: /cvs/stx/stx/libview/View.st,v 1.49 1995-12-15 13:05:22 cg Exp $'
269
ea536bb319a6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 219
diff changeset
   453
! !