Editing Uicontrols

Jump to navigation Jump to search
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.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
== uicontrols: Build a GUI in GNU Octave ==
= uicontrols: Build a GUI in GNU Octave =


You have to use the "qt" graphics toolkit (default since 4.0). For the best results GNU Octave version >= 4.2.x should be used.
You have to use the "qt" graphics toolkit (default since 4.0). For the best results GNU Octave version >= 4.2.x should be used.


=== Example 1: imageViewer ===
== Resources ==
 
* https://www.gnu.org/software/octave/doc/interpreter/GUI-Development.html
 
== Examples ==
 
=== imageViewer ===


GUI which opens a file selection dialog when a button is pressed and views the selected image.
GUI which opens a file selection dialog when a button is pressed and views the selected image.
Line 9: Line 15:
[[File:imageViewer1.png]] [[File:imageViewer2.png]]
[[File:imageViewer1.png]] [[File:imageViewer2.png]]


{{Code|imageViewer example|<syntaxhighlight lang="octave">
{{Code|imageViewer example|<pre>
%% In file 'imageViewer.m'
%% In file 'imageViewer.m'
function imageViewer ()
function imageViewer ()
Line 48: Line 54:
   axis image off
   axis image off
end
end
</syntaxhighlight>}}
</pre>}}


Then run <code>imageViewer()</code> from your terminal:
Then run <code>imageViewer()</code> from your terminal:


=== Example 2: demo_uicontrol ===
=== demo_uicontrol ===


This example tries to show all available uicontrols (needs Octave >= 4.0 and qt):
This example tries to show all available uicontrols (needs Octave >= 4.0 and qt):
Line 58: Line 64:
[[File:demo_uicontrol1.png]]
[[File:demo_uicontrol1.png]]


{{Code|demo_uicontrol.m|<syntaxhighlight lang="octave">
{{Code|demo_uicontrol.m|<pre>
## 20.03.2017 Andreas Weber <andy@josoansi.de>
## 20.03.2017 Andreas Weber <andy@josoansi.de>
## Demo which has the aim to show all available GUI elements.
## Demo which has the aim to show all available GUI elements.
Line 248: Line 254:
guidata (gcf, h)
guidata (gcf, h)
update_plot (gcf, true);
update_plot (gcf, true);
</syntaxhighlight>}}
</pre>}}
 
== See also ==
 
* [https://octave.org/doc/interpreter/GUI-Development.html GNU Octave manual -- GUI Development]


[[Category:Examples]]
[[Category:Examples]]
Please note that all contributions to Octave 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 Octave:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Template used on this page: