callback strangeness?
Rob Gayvert
rtg at rochester.rr.com
Tue Mar 15 13:17:06 UTC 2005
Cees de Groot wrote:
> Hi,
>
> I had:
>
> WxListCtrl
> DGVFileListCtrl
>
> I wanted:
>
> WxListCtrl
> DGVListCtrl
> DGVFileListCtrl
> DGVUserListCtrl
>
> So I set out with the RB to push up from the file list all that was
> possible. Now, when I push up methods like onGetItemText:count: and
> then test my app I get wx assertions that say that virtual functions
> where called that aren't supposed to be called around the C++ side
> of onGetItemText handling. Push down again, assertions go.
>
> Is there some strangeness related to looking up where a callback
> should land at the Squeak side of life?
Yep, just a bug in telling the underlying C++ object which callbacks the
Squeak object supports, in the case of a subclass more than one level
removed from the "concrete" class (in this instance, WxListCtrl). I
think this patch should fix it. Let me know how it works for you.
.. Rob
-------------- 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
^#()! !
!WxMenuBar class methodsFor: 'as yet unclassified' stamp: 'rtg 3/15/2005 07:48'!
callbackMethods
^#()! !
!WxPanel class methodsFor: 'as yet unclassified' stamp: 'rtg 3/15/2005 07:49'!
callbackMethods
^#()! !
!WxPopupWindow class methodsFor: 'as yet unclassified' stamp: 'rtg 3/15/2005 07:49'!
callbackMethods
^#()! !
!WxSashWindow class methodsFor: 'as yet unclassified' stamp: 'rtg 3/15/2005 07:49'!
callbackMethods
^#()! !
!WxSplitterWindow class methodsFor: 'as yet unclassified' stamp: 'rtg 3/15/2005 07:49'!
callbackMethods
^#()! !
!WxStatusBar class methodsFor: 'as yet unclassified' stamp: 'rtg 3/15/2005 07:50'!
callbackMethods
^#()! !
!WxTipWindow class methodsFor: 'as yet unclassified' stamp: 'rtg 3/15/2005 07:50'!
callbackMethods
^#()! !
More information about the Wxsqueak
mailing list