Re: [Gambas-user] gambas newbie question re custom events

2013-07-18 Thread Fabien Bodard
Why using an observer ? Le 19 juil. 2013 05:55, "Bruce" a écrit : > Here's a simple (albeit silly) demo of how to use the Observer class. > hth > Bruce > > > -- > See everything from the browser to the database with AppDy

Re: [Gambas-user] gambas newbie question re custom events

2013-07-18 Thread Bruce
Here's a simple (albeit silly) demo of how to use the Observer class. hth Bruce demo_events-0.0.1.tar.gz Description: application/compressed-tar -- See everything from the browser to the database with AppDynamics Get end-

[Gambas-user] gambas newbie question re custom events

2013-07-18 Thread Horst Herb
I would be most grateful if somebody could point me to a relevant section of documentation or provide me with a minimal example for my following problem: I have a data model (non-GUI) that wants to emit a custom event (eg "DataChanged"). Let's say for simplicity that the model is a simple string,

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Benoît Minisini
Le 18/07/2013 21:02, Ru Vuott a écrit : >> Nice workaround! > > Oh, thank you, Jussi. > > >> However I don't quite understand why it works (I think the >> library is in same thread than gbx3). >> > > I do not know, but we could wait for Benoit's answer about it. > > > Bye > vuott It works because

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Ru Vuott
> Nice workaround! Oh, thank you, Jussi. > However I don't quite understand why it works (I think the > library is in same thread than gbx3). > I do not know, but we could wait for Benoit's answer about it. Bye vuott ---

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Jussi Lahtinen
Nice workaround! However I don't quite understand why it works (I think the library is in same thread than gbx3). Jussi On Thu, Jul 18, 2013 at 8:47 PM, Ru Vuott wrote: > Hello, > > well, I have been able to run the application, but. using a shared > library .so written by me. > > I moved

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Ru Vuott
Hello, well, I have been able to run the application, but. using a shared library .so written by me. I moved the call to "callback" function and the same "callback" function in that shared library. Excuse me: I am so ashamed for the tricksy ! :-D Ok... Forget it! vuott

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Jussi Lahtinen
OK, this is not entirely clear to me (I will study). I just thought maybe it's fine if the callback function could be alone in it's own process. Jussi On Thu, Jul 18, 2013 at 8:01 PM, Benoît Minisini < gam...@users.sourceforge.net> wrote: > Le 18/07/2013 18:49, Jussi Lahtinen a écrit : > > Can

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Benoît Minisini
Le 18/07/2013 18:49, Jussi Lahtinen a écrit : > Can this be fixed by using Task? > > Jussi > I don't see how. Task is a child process, this has nothing to do with our problem: calling the Gambas interpreter inside a thread, which is not possible because the Gambas interpreter is not multi-thread

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Jussi Lahtinen
Can this be fixed by using Task? Jussi On Thu, Jul 18, 2013 at 7:31 PM, Benoît Minisini < gam...@users.sourceforge.net> wrote: > Le 18/07/2013 18:10, Ru Vuott a écrit : > > > > > Anyway, don't expect your callback to work, as it is run in another > >> thread, and the Gambas interpreter cannot

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Benoît Minisini
Le 18/07/2013 18:10, Ru Vuott a écrit : > > > Anyway, don't expect your callback to work, as it is run in another >> thread, and the Gambas interpreter cannot be run outside of the main thread. >> >> Regards, >> >> -- >> Benoît Minisini > > > So we can make any changes and corrections we want

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Ru Vuott
> Anyway, don't expect your callback to work, as it is run in another > thread, and the Gambas interpreter cannot be run outside of the main thread. > > Regards, > > -- > Benoît Minisini So we can make any changes and corrections we want, but it will never work? :-( vuott -

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Ru Vuott
> So, one byte size variable can present eight statuses at same time. > Example, if variable x has status A and C, it has value 5 = > 0101, etc. > > Jussi Ok, thanks. vuott -- See everything from the browser to th

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Ru Vuott
> Yep. To use external functions, you must know how C code is translated > by the compiler. And an 'enum' is translated to an 'int', which is an > Integer in Gambas. > > -- > Benoît Minisini Ok, thanks. vuott -- Se

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Benoît Minisini
Le 18/07/2013 17:32, Benoît Minisini a écrit : > Le 18/07/2013 16:53, Jussi Lahtinen a écrit : >> Maybe Benoit could send his modifications to this list? >> > > Here it is. I just changed the line I talked about, and run the code > outside of the GUI loop. > > Alas I was wrong, the program now cras

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Jussi Lahtinen
That code has still wrong size in memcpy, it should be gb.Single. With these corrections I got: (gdb) r Starting program: /usr/bin/gbx3 [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x77fdf700 (LWP 6225)] [N

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Jussi Lahtinen
Yeah, I was confused by jack documentation about usage of "word" and I chose Short... Jussi On Thu, Jul 18, 2013 at 6:34 PM, Benoît Minisini < gam...@users.sourceforge.net> wrote: > Le 18/07/2013 17:32, Jussi Lahtinen a écrit : > >> Uhmm... in ufficiale Jack documention I read: > >> > >> *

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Benoît Minisini
Le 18/07/2013 17:32, Jussi Lahtinen a écrit : >> Uhmm... in ufficiale Jack documention I read: >> >> * >> typedef enum JackStatus jack_status_t >> Status word returned from several JACK operations, formed by OR-ing >> together the relevant JackStatus bits. >> * >> >> and more: >> >> ***

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Benoît Minisini
Le 18/07/2013 16:53, Jussi Lahtinen a écrit : Maybe Benoit could send his modifications to this list? Here it is. I just changed the line I talked about, and run the code outside of the GUI loop. Alas I was wrong, the program now crashes again in jack_activate(). -- Benoît Minisini traJ

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Jussi Lahtinen
> Uhmm... in ufficiale Jack documention I read: > > * > typedef enum JackStatus jack_status_t > Status word returned from several JACK operations, formed by OR-ing > together the relevant JackStatus bits. > * > > and more: > > > enum JackStatus > > jack_status_t bits > > >

[Gambas-user] Gambas blob behavior: Problems with retreiving a binary file stored in a database

2013-07-18 Thread PICCORO McKAY Lenz
hi benoit, my englys its bad due i hate the languaje i cannot classified this behavior as a bug, i explain: I discovered a small hole in the language "gambas", apparently the data management type "blob" in mysql is the worst, and since the only DBMS that developers of gambas used in advance, its

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Ru Vuott
Hello Jussi, >> have you read Benoît's message ? > No, Benoit must have been replied to you, not to this list. Oh, yes, excuse me. > I originally understood short would be correct, but I also tried integer. Uhmm... in ufficiale Jack documention I read: * typedef enum JackStatu

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Jussi Lahtinen
> have you read Benoît's message ? No, Benoit must have been replied to you, not to this list. > ** > 1) I rewrite the code at line 62. > > Dim status As Integer > > client = jack_client_open(nomeClient, JackNullOption, VarPtr(status), Null) > > (the status arg

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Ru Vuott
> But maybe we just missed something from the C to Gambas translation... > > Jussi I hope... not ! :-( About it, I'ld like to rember that if I cancel the "callback" function and any reference to it, the little Gambas application works well: in fact it connect itself regularly to sound genera

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Ru Vuott
Hello Jussi, have you read Benoît's message ? Where he tells he seems to have been running my Gambas code (...if I do not have mistranslated ) : *** I can run your program with no crash if albeit with some precautions: **

Re: [Gambas-user] A "Callback" function doesn't work.

2013-07-18 Thread Jussi Lahtinen
> > Dim status As Short > > > > client = jack_client_open(nomeClient, options, > > VarPtr(status), Null) > > However... the relative compiled program was created, and launched in > Terminal I obtained this value: 4 > OK, so with memcpy you should use sizeof(gb.Single). After these corrections