view bug (with feel attribute)
[1/6] from: media::quazart::com at: 23-Oct-2001 13:07
Hi again,
maybe some of you are aware...
I just discovered that if you create your feel object for a face and include
the functions in the wrong order, your event handling will be PURE CHAOS!!!
anything. other than:
make object! [
redraw: none
detect: none
over: none
engage: none
]
Just changing the order of the function completely breaks the event
handling. It guess that the view handler calls the feel function with a
static binding, always expecting the order of their inclusion.
The documentation for the event handling (on RT How-to site) is misleading
it states: "Any face can have a FEEL object with one or more of the above
functions. This allows you to handle events from any type of graphical
object, including images, text, boxes, or lines."
It later SUGGESTS to clone the feel object... But I'd change that part of
the text to you MUST CLONE the feel object.
I hope someone can explain this to me or prove me wrong, I have the exact
same behaviour in more than one source!
-Max
[2/6] from: holger:rebol at: 23-Oct-2001 10:28
On Tue, Oct 23, 2001 at 01:07:53PM -0400, Media wrote:
> Hi again,
>
> maybe some of you are aware...
>
> I just discovered that if you create your feel object for a face and include
> the functions in the wrong order, your event handling will be PURE CHAOS!!!
Sure, that is expected. Any time you create an instance of an object
with a predefined structure you MUST use the template object. You cannot
roll your own object from scratch and expect the result to be compatible
with the template.
This means use make face [...], make feel [...] etc., not make object! [...].
--
Holger Kruse
[holger--rebol--com]
[3/6] from: media:quazart at: 23-Oct-2001 14:52
----- Original Message -----
From: <[holger--rebol--com]>
Sent: Tuesday, October 23, 2001 1:28 PM
Subject: [REBOL] Re: view bug (with feel attribute)
> On Tue, Oct 23, 2001 at 01:07:53PM -0400, Media wrote:
> > I just discovered that if you create your feel object for a face and
include
> > the functions in the wrong order, your event handling will be PURE
CHAOS!!!
> Sure, that is expected.
I guess its my turn to feel a little dumb (no pun intented ;-) I can see it
comming...
> Any time you create an instance of an object
> with a predefined structure you MUST use the template object. You cannot
> roll your own object from scratch and expect the result to be compatible
> with the template.
>
Ah, then you mean I've been lucky, in general, for the last 2 years ':-D
damn!
well, thanks for the pointer... it ain't that obvious because when you probe
objects... it leads one to think that the structure is not as relevent as in
other languages. I really thought that the object structure was more
dynamic...
> This means use make face [...], make feel [...] etc., not make object!
[...].
What led me to use "make object! [...]" was that the following code
returns an error (in rebol/view)!
--------------------------
rebol []
myfeel: make feel []
** Script Error: feel has no value
** Where: do-boot
** Near: myfeel: make feel []
-----------------------------------
Although I have now cloning the feel object from other Faces... I think it
would be nice that the docs mention how to do it explicitely... since the
docs do take the time to talk about the feel object ... just a short example
like:
myface: make face []
myface/feel: make myface/feel [] (creates a clone of the default feel
created by make face)
Can you then confirm or infirm the following sentence?:
objects are static contexts, contrary to the global context which is
dynamic
Thanks!
-Maxim
PS: I still think the doc should be modified as I explained... it might help
someone else to keep from doing the same mistake.
[4/6] from: media:quazart at: 23-Oct-2001 16:02
Hi All,
For those of you following this thread,
The following code works.... Although it all seems obvious by now, when I
started work on all of this, this morning, let me assure you that I was
really wondering what was going wrong...
I am just supplying this for completeness (now I see how Holger intended his
answer)... thanks Holger. In fact, inside the face, the elements can all
clone references to themselves (of course ;-), making them effectively local
and unique.
--------- code snippet follows -----------------
rebol []
myface: make face [
feel: make feel []
]
ciao!
-Max
-----------------------------------------
Maxim Olivier-Adlhoch
Directeur Technique
Quaz'Art
[5/6] from: ammonjohnson:yaho:o at: 23-Oct-2001 17:12
What is wrong with
stylize [
myface: box with [
feel: []
]
]
??
Enjoy!!
Ammon
[6/6] from: media:quazart at: 24-Oct-2001 10:43
effectively, the use of with, is just about the same :-)
but you are still using VID in the end...
I am not...
My secret project actually relies on the fact of not using VID... I'm not
bitchin VID... I'm just attempting something for which VID is a little (or
a lot) awkwards to use.
cheers!
-Maxim