Re: Event handler method in component

2019-11-11 Thread Jeremy Roussak via 4D_Tech
Chip, you’re right. For my purposes, that isn’t an issue, but your approach is perhaps neater. Jeremy > On 11 Nov 2019, at 16:43, Chip Scheide <4d_o...@pghrepository.org> wrote: > > Jeremy, > Just to be clear > > your code will *only* work if both the component and host are > interpreted. >

Re: Event handler method in component

2019-11-11 Thread Chip Scheide via 4D_Tech
Jeremy, Just to be clear your code will *only* work if both the component and host are interpreted. for me, one of the advantages of using a component is being able to compile it. For that circumstance you will need to have some other means to inject code. as I said I use text files in the

Re: Event handler method in component

2019-11-11 Thread Jeremy Roussak via 4D_Tech
Exactly. FWIW, this is my code. The METHOD SET ATTRIBUTES call allows the injected method to be used as a callback. Methods to be injected begin with an underscore in the component, which is removed when creating the method in the host. Jeremy METHOD GET NAMES($omNames;"_OM@")

Re: Event handler method in component

2019-11-11 Thread Chip Scheide via 4D_Tech
as a bonus you can update the code in the method(s) you are injecting as needs change (or bugs are found and fixed), by simply allowing the injection method to overwrite the existing code. Chip On Mon, 11 Nov 2019 15:09:34 +, Jeremy Roussak wrote: > Chip, you read my mind - that is almost

Re: Event handler method in component

2019-11-11 Thread Jeremy Roussak via 4D_Tech
Chip, you read my mind - that is almost exactly what I implemented yesterday afternoon. It was really easy to do and it works a treat. Jeremy > On 11 Nov 2019, at 15:06, Chip Scheide <4d_o...@pghrepository.org> wrote: > > another option - depending on your view of doing this... is Code >

Re: Event handler method in component

2019-11-11 Thread Chip Scheide via 4D_Tech
another option - depending on your view of doing this... is Code injection. At startup of the host (will have to be started at least once interpretedly) you copy the code for the event call method into a method in the host. it looks something like this (interpreted host and component): METHOD

Re: Event handler method in component

2019-11-11 Thread Patrick Emanuel via 4D_Tech
Hi Arnaud, I had also the same problem and the only way I found is, like all of us, to insert a method onto the host to call back it. Not sure that the object is a solution. Nothing found on this and not sure that another solution exists. Patrick - Patrick EMANUEL

Re: Event handler method in component

2019-11-11 Thread Arnaud de Montard via 4D_Tech
> Le 10 nov. 2019 à 19:07, Jeremy Roussak via 4D_Tech <4d_tech@lists.4d.com> a > écrit : > > I’d like to have a method set by ON EVENT CALL to live in a component. It > works, in that the method is called on each event, but the system variables > Modifiers and KeyCode are undefined so testing

Re: Event handler method in component

2019-11-10 Thread Jeremy Roussak via 4D_Tech
Thanks, Tim. I thought that was probably the case. Jeremy > On 10 Nov 2019, at 20:22, Tim Nevels via 4D_Tech <4d_tech@lists.4d.com> wrote: > > On Nov 10, 2019, at 2:00 PM, Jeremy Roussak wrote: > >> I’d like to have a method set by ON EVENT CALL to live in a component. It >> works, in that

Re: Event handler method in component

2019-11-10 Thread Tim Nevels via 4D_Tech
On Nov 10, 2019, at 2:00 PM, Jeremy Roussak wrote: > I’d like to have a method set by ON EVENT CALL to live in a component. It > works, in that the method is called on each event, but the system variables > Modifiers and KeyCode are undefined so testing for the event itself is tricky. > > I