Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
GNU Octave
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== GUI applications == With Octave code, the user can create GUI applications. See [https://octave.org/doc/v7.1.0/GUI-Development.html GUI Development (GNU Octave (version 7.1.0))]. Below are some examples: Button, edit control, checkbox<syntaxhighlight lang="octave"> # create figure and panel on it f = figure; # create a button (default style) b1 = uicontrol (f, "string", "A Button", "position",[10 10 150 40]); # create an edit control e1 = uicontrol (f, "style", "edit", "string", "editable text", "position",[10 60 300 40]); # create a checkbox c1 = uicontrol (f, "style", "checkbox", "string", "a checkbox", "position",[10 120 150 40]); </syntaxhighlight>Textbox<syntaxhighlight lang="octave"> prompt = {"Width", "Height", "Depth"}; defaults = {"1.10", "2.20", "3.30"}; rowscols = [1,10; 2,20; 3,30]; dims = inputdlg (prompt, "Enter Box Dimensions", rowscols, defaults); </syntaxhighlight>Listbox with message boxes.<syntaxhighlight lang="octave"> my_options = {"An item", "another", "yet another"}; [sel, ok] = listdlg ("ListString", my_options, "SelectionMode", "Multiple"); if (ok == 1) msgbox ("You selected:"); for i = 1:numel (sel) msgbox (sprintf ("\t%s", my_options{sel(i)})); endfor else msgbox ("You cancelled."); endif </syntaxhighlight>Radiobuttons<syntaxhighlight lang="octave"> # create figure and panel on it f = figure; # create a button group gp = uibuttongroup (f, "Position", [ 0 0.5 1 1]) # create a buttons in the group b1 = uicontrol (gp, "style", "radiobutton", "string", "Choice 1", "Position", [ 10 150 100 50 ]); b2 = uicontrol (gp, "style", "radiobutton", "string", "Choice 2", "Position", [ 10 50 100 30 ]); # create a button not in the group b3 = uicontrol (f, "style", "radiobutton","string", "Not in the group","Position", [ 10 50 100 50 ]); </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)