Re: Trouble: GTK + Octave + PThreads




[gtk-list people: if this thread is becoming too Octave-specific, please
tell me and I will remove the gtk-list address from the Cc: list.]

Hi John,

Thanks for your reply.

>>>>> "JWE" == John W Eaton <jwe@bevo.che.wisc.edu> writes:

    JWE> Are you working on creating a set of programmable GUI objects
    JWE> that can be used from Octave, or a GUI front end that would
    JWE> communicate with Octave?

Mine is the first case.

    JWE> I'm not sure why Posix threads would be needed.  

With GTK+ (as with other X-based GUI toolkits) it is necessary to launch
a main loop (gtk_main, for instance) which will take care of the mouse
events.  As my application will be launched from the Octave prompt, it
gets blocked when gtk_main is called, unless I use threads.

    JWE> Can't you just use something like select() to decide where
    JWE> input is coming from?

Yes, if my application would be taking care of the readline loop, which
is not the case (Octave is doing it).

    JWE> With Tcl/Tk and some other X-based GUI toolkits, it is
    JWE> relatively easy to continue to get input from the readline
    JWE> prompt while also allowing the GUI objects to function.  

I am not sure, but I think that with Tcl/Tk, the function Tcl_Init
spawns a whole new process, which communicate with the main program
through Tcl_Eval.  This is not the case of the application I am planning
to write, as the GUI interface will be able to alter directly the
workspace data of Octave.

    JWE> What does -D_REENTRANT do for complinig Octave?

I compiled version 2.0.13.91 with -D_REENTRANT.  It works normally. 

--
Rafael Laboissiere
Institut de la Communication Parlee | Email: rafael@icp.inpg.fr
UPRESS A CNRS 5009 / INPG           | Voice: +33 4.76.57.48.49
46, av. Felix Viallet               |   Fax: +33 4.76.57.47.10
F-38031 Grenoble CEDEX 1 France     |   URL: http://www.icp.inpg.fr/~rafael





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]