Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
GNU Octave
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
GNU Octave
(section)
Add topic