SimpleView.st
changeset 2465 193a96bd94d7
parent 2454 f708fb443ffe
child 2489 f7ce16896fa1
equal deleted inserted replaced
2464:ad7fcfff0b0c 2465:193a96bd94d7
  6136 destroy
  6136 destroy
  6137     "unmap & destroy - make me invisible, destroy subviews then
  6137     "unmap & destroy - make me invisible, destroy subviews then
  6138      make me unknown to the device"
  6138      make me unknown to the device"
  6139 
  6139 
  6140     realized ifTrue:[
  6140     realized ifTrue:[
  6141 	self unmap.            
  6141         self unmap.            
  6142 "/        "make it go away immediately
  6142 "/        "make it go away immediately
  6143 "/         - also, this hides the subview killing"
  6143 "/         - also, this hides the subview killing"
  6144 "/
  6144 "/
  6145 "/        device synchronizeOutput. 
  6145 "/        device synchronizeOutput. 
  6146 
  6146 
  6147     ].
  6147     ].
       
  6148     shown := false.
  6148 
  6149 
  6149 "/    controller notNil ifTrue:[
  6150 "/    controller notNil ifTrue:[
  6150 "/      controller release.
  6151 "/      controller release.
  6151 "/      controller := nil.
  6152 "/      controller := nil.
  6152 "/    ].
  6153 "/    ].
  6153 
  6154 
  6154     subViews notNil ifTrue:[
  6155     subViews notNil ifTrue:[
  6155 	self destroySubViews.
  6156         self destroySubViews.
  6156     ].
  6157     ].
  6157     superView notNil ifTrue:[
  6158     superView notNil ifTrue:[
  6158 	superView removeSubView:self.
  6159         superView removeSubView:self.
  6159 	superView := nil
  6160         superView := nil
  6160     ].
  6161     ].
  6161     super destroy.
  6162     super destroy.
  6162 
  6163 
  6163 "/    superView isNil ifTrue:[
  6164 "/    superView isNil ifTrue:[
  6164 "/        device flush
  6165 "/        device flush
  6165 "/    ].
  6166 "/    ].
  6166 
  6167 
  6167     controller notNil ifTrue:[
  6168     controller notNil ifTrue:[
  6168 	controller release.
  6169         controller release.
  6169 	controller := nil.
  6170         controller := nil.
  6170     ].
  6171     ].
  6171 
  6172 
  6172     windowGroup notNil ifTrue:[
  6173     windowGroup notNil ifTrue:[
  6173 	windowGroup removeView:self.
  6174         windowGroup removeView:self.
  6174 	windowGroup := nil
  6175         windowGroup := nil
  6175     ].
  6176     ].
  6176 
  6177 
  6177     "Modified: 3.5.1996 / 23:49:24 / stefan"
  6178     "Modified: / 3.5.1996 / 23:49:24 / stefan"
  6178     "Modified: 20.3.1997 / 22:11:53 / cg"
  6179     "Modified: / 18.2.1999 / 22:16:09 / cg"
  6179 !
  6180 !
  6180 
  6181 
  6181 fetchDeviceResources
  6182 fetchDeviceResources
  6182     "fetch all device specific resources. This is invoked,
  6183     "fetch all device specific resources. This is invoked,
  6183      when the view is made visible on some device for the very first
  6184      when the view is made visible on some device for the very first
  6731 
  6732 
  6732 unmap
  6733 unmap
  6733     "hide me - the view stays created, and can be remapped again later."
  6734     "hide me - the view stays created, and can be remapped again later."
  6734 
  6735 
  6735     realized ifTrue:[
  6736     realized ifTrue:[
  6736 	drawableId notNil ifTrue:[
  6737         realized := false.
  6737 	    realized := false.
  6738         drawableId notNil ifTrue:[
  6738 	    device unmapWindow:drawableId
  6739             device unmapWindow:drawableId
  6739 	].
  6740         ].
  6740 	shown := realized := false.
  6741 
       
  6742         "/ cg: used to clear shown here,
       
  6743         "/ but this is not correct with X, where the
       
  6744         "/ unmap is an asyncronous operation.
       
  6745         "/ (must wait for unmapped event to clear shown)
       
  6746 
       
  6747         "/ shown := false."
  6741     ].
  6748     ].
  6742 
  6749 
  6743     "
  6750     "
  6744      |top sub|
  6751      |top sub|
  6745 
  6752 
  6746      top := StandardSystemView new.
  6753      top := StandardSystemView new.
  6747      top extent:200@200.
  6754      top extent:200@200.
  6748 
  6755 
  6749      sub := View
  6756      sub := View
  6750 		origin:0.2@0.2
  6757                 origin:0.2@0.2
  6751 		corner:0.8@0.8
  6758                 corner:0.8@0.8
  6752 		in:top.
  6759                 in:top.
  6753 
  6760 
  6754      sub viewBackground:Color red.
  6761      sub viewBackground:Color red.
  6755      sub hiddenOnRealize:true.
  6762      sub hiddenOnRealize:true.
  6756 
  6763 
  6757      top open.
  6764      top open.
  6762      sub viewBackground:(Color green).
  6769      sub viewBackground:(Color green).
  6763      (Delay forSeconds:3) wait.
  6770      (Delay forSeconds:3) wait.
  6764      sub map.
  6771      sub map.
  6765     "
  6772     "
  6766 
  6773 
  6767     "Modified: 25.2.1997 / 23:13:26 / cg"
  6774     "Modified: / 22.2.1999 / 20:10:58 / cg"
  6768 !
  6775 !
  6769 
  6776 
  6770 unrealize
  6777 unrealize
  6771     "alias for unmap, for historic reasons"
  6778     "alias for unmap, for historic reasons"
  6772 
  6779 
  7971 ! !
  7978 ! !
  7972 
  7979 
  7973 !SimpleView class methodsFor:'documentation'!
  7980 !SimpleView class methodsFor:'documentation'!
  7974 
  7981 
  7975 version
  7982 version
  7976     ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.293 1999-02-15 20:14:41 cg Exp $'
  7983     ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.294 1999-02-22 19:11:52 cg Exp $'
  7977 ! !
  7984 ! !
  7978 SimpleView initialize!
  7985 SimpleView initialize!