octave-maintainers
[Top][All Lists]
Advanced

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

More GUI talk...


From: Søren Hauberg
Subject: More GUI talk...
Date: Sun, 30 Mar 2008 13:03:13 +0200

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

Cheers,
Søren

Attachment: simple_gui.cc
Description: Text Data


reply via email to

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