help-octave
[Top][All Lists]
Advanced

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

Re: building portable gui working under octave and matlab in all support


From: Mike Miller
Subject: Re: building portable gui working under octave and matlab in all supported OSs
Date: Tue, 19 Apr 2016 10:22:29 -0700
User-agent: Mutt/1.5.24 (2015-08-30)

On Tue, Apr 19, 2016 at 07:16:06 +0000, Alex Vong wrote:
> Hi,
> 
> I am a student taking a required course in matlab. I am given an
> assignment to build a gui in it. According to my teacher, the only
> requirement is that it is all written in m-files. Is it possible to
> build a gui in octave such that it works in matlab as well? I
> personally use gnu/linux, my school use windows, some of my tutors
> uses os x, so it has to work in all three OSs. Currently, I use the
> trick which generate a perl script at runtime, saving in to temporary
> directory and execute it. The perl script uses Tk to build the gui.
> Does anyone know of a better method?

That sounds like it's not written in m-files at all.

I think the portable Octave / Matlab way to create a GUI would be using
the uimenu, uicontrol, etc, functions.

See https://www.gnu.org/software/octave/doc/interpreter/UI-Elements.html
for all of the available functions.

A small motivating example (using Octave syntax):

  win = figure ("menubar", "none", "position", [0 0 640 480]);
  file_menu = uimenu (win, "label", "File");
  help_menu = uimenu (win, "label", "Help");
  exit_action = uimenu (file_menu, "label", "Exit", ...
                        "callback", @() close (win));
  canvas = uipanel ();
  button = uicontrol ("style", "pushbutton", "string", "Push Me", ...
                      "position", [0 460 100 20], ...
                      "callback", @() disp ("pushed"));

-- 
mike



reply via email to

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