octave-maintainers
[Top][All Lists]
Advanced

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

Re: More GUI talk...


From: dbateman
Subject: Re: More GUI talk...
Date: Sun, 30 Mar 2008 08:10:36 -0700 (PDT)



Soren Hauberg wrote:
> 
> Hi All,
>   So, there has been some talk about why Octave is such an awful product
> that only comes with a DOS gui, and that's totally useless, and
> everybody sucks (or something like that).
>   I don't know much about creating GUI's, so I've always found it hard
> to understand why it is so hard to create one. In an effort to
> understand the issues, I tried to create a quick-and-dirty GUI, that
> runs in the same process as Octave. The basic idea is to create an
> oct-file that creates the GUI, and then starts the GUI mainloop. Control
> will then not return to the Octave mainloop until the GUI is closed.
> When the user enters a command into the GUI it is then evaluated with
> "eval_string". std::cout and std::cerr is then redirected to the GUI, so
> the user can view the result in the GUI. Since all this happens in an
> oct-file, we have access to the symbol table, and all sorts of other
> stuff. If we want, we can also have complete control of how each key
> press is handled, so I assume it would be possible to do all the fancy
> stuff like tab-completion, etc.
>   Anyway, I'm attaching some very-ugly code that implements a
> simple-but-awful GUI. It uses gtkmm, so if you want to try it, you need
> developer libraries for that (that should be in all linux distros). You
> can compile the code using:
> 
>    mkoctfile -Wall `pkg-config --cflags gtkmm-2.4` `pkg-config --libs
> gtkmm-2.4` simple_gui.cc
> 
> and you can run the GUI directly from the command line by typing
> 
>   octave -q --eval simple_gui
> 
> There's a screenshot at
> http://hauberg.org/wiki/lib/exe/fetch.php?cache=cache&media=screenshot.png
> 

This is the approach that Workshop, etc take. The problem is that this
doesn't work well with readline, octave's history or multi-line entry. For
example try entering a matrix like

a = [ 1, 2, 3
  4, 5, 6];

at your prompt. The right way would be you create a virtual terminal device
in which the instance of Octave runs and then the Octave commandline,
history, readline etc is handled consistently in Octave itself. However a
virtual terminal device seems difficult to implement in Windows, 

D.
-- 
View this message in context: 
http://www.nabble.com/More-GUI-talk...-tp16380915p16383155.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]