'within? not found into View 1.2.10 ... ?
[1/5] from: Christophe:Coussement:mil:be at: 28-Aug-2003 13:00
Hi list, As I just got the new Encap/Command from Cindy, I wanted to convert an app from [View 18.104.22.168.1] to [22.214.171.124.1], working under WinNT 4.0 SP6. Now ... in my interface, each time the func 'wake-event is called, I get this weird error: make object! [ code: 300 type: 'script id: 'no-value arg1: 'within? arg2: none arg3: none near: [either any [pop-face = event/face within? event/offset win-offset? pop-face pop-face/size] [ no-btn: false if block? get in pop-face 'pane [ no-btn: foreach item pop-face/pane [if get in item 'action [break/return false] true] ] if any [all [event/type = 'up no-btn] event/type = 'close] [hide-popup] do event ] [ if pop-face/action [ if not find [move time] event/type [hide-popup] do event ] ]] where: 'wake-event ] The libs %mezz.r and %view.r (requested for building View from Base) are #included. I tried to: - redefine the 'within? func by placing its source in my code, but this approach does not work. - #include a dropped system/view object (in the hope the func should be overwritten), but it does not work either... Has anybody an idea about what's going wrong here ? Thanks a lot ! ==xtof
[2/5] from: brett:codeconscious at: 29-Aug-2003 22:38
I'm not sure what you mean by "... each time the func 'wake-event is called ..." Can you cut your program down to the smallest example that still demonstrates the problem and post it here? Brett.
[3/5] from: Christophe:Coussement:mil:be at: 1-Sep-2003 10:27
> > I'm not sure what you mean by "... each time the func > 'wake-event is called > ..." > > Can you cut your program down to the smallest example that still > demonstrates the problem and post it here? > > Brett. >
I was hoping someone ever had the same problem... Well the error is hard to isolate and reconstitue :( I guess when I find it, I will have the solution too... Thanks anyway to take the time to ask for details, Brett ;-) ==xtof
[4/5] from: Christophe::Coussement::mil::be at: 1-Sep-2003 14:01
Re: 'within? not found into View 1.2.10 ... ? : the solution!
Hi fellow Rebolers, After minimalizing my code (2000+ LOC written two years ago) until I could distinguish the bug, I had to conclude I was not overriding the definition of 'within?, which was my first hypothesis. The truth was much more simple (shame on me!), and I hope the solution will eventualy help others... When using the encap (in my case: REBOL/Encap 126.96.36.199.1, in the last SDK/Cmd): my-ctx: context [ #include %../source/view.r #include %../source/mezz.r view center-face layout [ choice data ["a" "b" "c"] ] ] will cause the error mentionned. Extracting the libs from the context is the solution: #include %../source/view.r #include %../source/mezz.r my-ctx: context [ view center-face layout [ choice data ["a" "b" "c"] ] ] The reason is, I suppose IMHO, the bin code from REBOL which is added during the Encap process is added outside the context I defined, so it could not access the requested 'within? function, which was protected by the context. I'm - again - one lesson richer today ;-) ==xtof
[5/5] from: brett:codeconscious at: 1-Sep-2003 22:28
I was a bit worried you were going "to put up the white flag" too early, but you came through and with the solution too! :^)
> Extracting the libs from the context is the solution:
Interesting result. Thanks for posting the solution. Brett.