callback strangeness?

Rob Gayvert rtg at rochester.rr.com
Tue Mar 15 13:53:55 UTC 2005


Sorry, ignore that last so-called fix. Here's one that has a better 
chance of working.
-------------- next part --------------
'From Squeak3.7 of ''4 September 2004'' [latest update: #5989] on 15 March 2005 at 7:58:04 am'!
!WxBase methodsFor: 'as yet unclassified' stamp: 'rtg 3/15/2005 07:47'!
setCallbackFlags

	"Determine which callbacks are implemented by my class. IMPORTANT NOTE: flags are ordered
	 by method name alphabetically."
	
	| cm md flags flag cls |
	
	"use only if this class has an underlying sqWxXXX class"
	cm := WxGenericCallback callbackMethodsFor: self class.
	cm ifNil: [ ^self ].
	
	cls := self class.
	flags := 0.
	
	"Look for callback selectors up to the first concrete wx class."
	[cls notNil and: [ (cls class includesSelector: #callbackMethods) not ]] whileTrue: [
		md := cls methodDictionary.
		flag := 1.
		cm keys asSortedCollection do: [:selector |
			(md includesKey: selector) 
				ifTrue: [ flags := flags bitOr: flag ].
			flag := flag bitShift: 1.
		].
		cls := cls superclass.
	].

	(Wx debugCallbacks & (flags ~= 0)) 
		ifTrue: [ Wx debug: 'setCallbackFlags: obj=', self asString, ', flags=', flags asString ].

	flags = 0 ifFalse: [ self setCallbackFlags: flags ].
	
	^flags! !
!WxControl class methodsFor: 'as yet unclassified' stamp: 'rtg 3/15/2005 07:47'!
callbackMethods

	^Dictionary new! !
!WxMenuBar class methodsFor: 'as yet unclassified' stamp: 'rtg 3/15/2005 07:48'!
callbackMethods

	^Dictionary new! !
!WxPanel class methodsFor: 'as yet unclassified' stamp: 'rtg 3/15/2005 07:49'!
callbackMethods

	^Dictionary new! !
!WxPopupWindow class methodsFor: 'as yet unclassified' stamp: 'rtg 3/15/2005 07:49'!
callbackMethods

	^Dictionary new! !
!WxSashWindow class methodsFor: 'as yet unclassified' stamp: 'rtg 3/15/2005 07:49'!
callbackMethods

	^Dictionary new! !
!WxSplitterWindow class methodsFor: 'as yet unclassified' stamp: 'rtg 3/15/2005 07:49'!
callbackMethods

	^Dictionary new! !
!WxStatusBar class methodsFor: 'as yet unclassified' stamp: 'rtg 3/15/2005 07:50'!
callbackMethods

	^Dictionary new! !
!WxTipWindow class methodsFor: 'as yet unclassified' stamp: 'rtg 3/15/2005 07:50'!
callbackMethods

	^Dictionary new! !
        
WxGenericCallback initializeCallbacks!


More information about the Wxsqueak mailing list