SlideShare a Scribd company logo
Programming a GUIDE
GUI
Prepared by:
Mahmoud Hikmet
Mostafa Majid
Working with Callbacks in GUIDE
How to Use the Example Code
Push Button
Toggle Button
Radio Button
Check Box
Edit Text
Slider
Topics:
List Box
Pop-Up Menu
Panel
Button Group
Menu Item
Table
Axes
Working with Callbacks in GUIDE
Working with Callbacks in GUIDE
display( 'Goodbye' );
close(gcf);
Push Button
Toggle Button
button_state = get(hObject, 'Value' );
if button_state == get(hObject, 'Max' )
display( 'down' );
elseif button_state == get(hObject, 'Min' )
display( 'up' );
end
Radio Button & Check Box
if (get(hObject, 'Value' ) == get(hObject, 'Max' ))
display( 'Selected' );
else
display( 'Not selected' );
end
Edit Text
input = get(hObject, 'String' );
display(input);
Strings
Retrieve Numeric Values
input = str2double(get(hObject, 'string' ));
if isnan(input)
errordlg( 'You must enter a numeric value' , 'Invalid Input' ,
'modal' )
uicontrol(hObject)
return
else
display(input);
end
List Box & Pop-Up Menu
items = get(hObject, 'String' );
index_selected = get(hObject, 'Value' );
item_selected = items{index_selected};
display(item_selected);
Panel
display( 'Mouse button was pressed' );
Resize the Window and Panel
By default, GUIDE GUIs cannot be resized, but you can
override this behavior by
selecting Tools > GUI Options and
setting Resize behavior to Proportional.
set(hObject, 'Units' , 'Points' )
panelSizePts = get(hObject, 'Position' );
panelHeight = panelSizePts(4);
set(hObject, 'Units' , 'normalized' );
newFontSize = 10 * panelHeight / 115;
texth = findobj( 'Tag' , 'text1' );
set(texth, 'FontSize' ,newFontSize);
Button Group
Button groups are similar to panels, but they also manage
exclusive selection of radio buttons and toggle buttons.
When a button group contains multiple radio buttons or
toggle buttons, the button group allows the end user to
select only one of them.
switch get(eventdata.NewValue,'Tag')
case 'radiobutton1'
display( 'Radio button 1' );
case 'radiobutton2'
display( 'Radio button 2' );
case 'togglebutton1'
display( 'Toggle button 1' );
case 'togglebutton2'
display( 'Toggle button 2' );
end
.
Axes & Slider
a=get(handles.slider1,'Value');
x=0:0.1:50;
y=sin(x*a);
plot(handles.axes1,x,y)
Simple Project
Design Calculator
By Mat lab
• Design the calculator
• In the button write this code
a= str2num(get(handles.edit1,'string'));
b= str2num(get(handles.edit2,'string'));
c=a+b;
set(handles.text3,'string',c);
• In the button write this code
a= str2num(get(handles.edit1,'string'));
b= str2num(get(handles.edit2,'string'));
c=a-b;
set(handles.text3,'string',c);
• In the button write this code
a= str2num(get(handles.edit1,'string'));
b= str2num(get(handles.edit2,'string'));
c=a*b;
set(handles.text3,'string',c);
• In the button write this code
a= str2num(get(handles.edit1,'string'));
b= str2num(get(handles.edit2,'string'));
c=a/b;
set(handles.text3,'string',c);
Thank you

More Related Content

What's hot

H.W 2
H.W 2H.W 2
The Ring programming language version 1.5.1 book - Part 62 of 180
The Ring programming language version 1.5.1 book - Part 62 of 180The Ring programming language version 1.5.1 book - Part 62 of 180
The Ring programming language version 1.5.1 book - Part 62 of 180
Mahmoud Samir Fayed
 
Dbms file
Dbms fileDbms file
Dbms file
Archita Misra
 
The Ring programming language version 1.6 book - Part 68 of 189
The Ring programming language version 1.6 book - Part 68 of 189The Ring programming language version 1.6 book - Part 68 of 189
The Ring programming language version 1.6 book - Part 68 of 189
Mahmoud Samir Fayed
 
Simple swing programs
Simple swing programsSimple swing programs
Simple swing programs
vishal choudhary
 
ejemplos gambas
ejemplos gambasejemplos gambas
ejemplos gambas
eduann
 
Ensayo
EnsayoEnsayo
Python basic Program
Python basic ProgramPython basic Program
Python basic Program
nuripatidar
 
Of class2
Of class2Of class2
Of class2
Janet Huang
 
Phoenix for laravel developers
Phoenix for laravel developersPhoenix for laravel developers
Phoenix for laravel developers
Luiz Messias
 
The Ring programming language version 1.5.1 book - Part 54 of 180
The Ring programming language version 1.5.1 book - Part 54 of 180The Ring programming language version 1.5.1 book - Part 54 of 180
The Ring programming language version 1.5.1 book - Part 54 of 180
Mahmoud Samir Fayed
 
cafeteria info management system
cafeteria info management systemcafeteria info management system
cafeteria info management system
Gaurav Subham
 
What Referential Transparency can do for you
What Referential Transparency can do for youWhat Referential Transparency can do for you
What Referential Transparency can do for you
Luka Jacobowitz
 
Programas Gambas
Programas GambasProgramas Gambas
Programas Gambas
guestdd103d
 
MFC Rect1
MFC Rect1MFC Rect1
Scala+swing
Scala+swingScala+swing
Scala+swing
perneto
 
Gambas
GambasGambas
Gambas
guestae07b6
 
Yolygambas
YolygambasYolygambas
Yolygambas
guest286373
 

What's hot (18)

H.W 2
H.W 2H.W 2
H.W 2
 
The Ring programming language version 1.5.1 book - Part 62 of 180
The Ring programming language version 1.5.1 book - Part 62 of 180The Ring programming language version 1.5.1 book - Part 62 of 180
The Ring programming language version 1.5.1 book - Part 62 of 180
 
Dbms file
Dbms fileDbms file
Dbms file
 
The Ring programming language version 1.6 book - Part 68 of 189
The Ring programming language version 1.6 book - Part 68 of 189The Ring programming language version 1.6 book - Part 68 of 189
The Ring programming language version 1.6 book - Part 68 of 189
 
Simple swing programs
Simple swing programsSimple swing programs
Simple swing programs
 
ejemplos gambas
ejemplos gambasejemplos gambas
ejemplos gambas
 
Ensayo
EnsayoEnsayo
Ensayo
 
Python basic Program
Python basic ProgramPython basic Program
Python basic Program
 
Of class2
Of class2Of class2
Of class2
 
Phoenix for laravel developers
Phoenix for laravel developersPhoenix for laravel developers
Phoenix for laravel developers
 
The Ring programming language version 1.5.1 book - Part 54 of 180
The Ring programming language version 1.5.1 book - Part 54 of 180The Ring programming language version 1.5.1 book - Part 54 of 180
The Ring programming language version 1.5.1 book - Part 54 of 180
 
cafeteria info management system
cafeteria info management systemcafeteria info management system
cafeteria info management system
 
What Referential Transparency can do for you
What Referential Transparency can do for youWhat Referential Transparency can do for you
What Referential Transparency can do for you
 
Programas Gambas
Programas GambasProgramas Gambas
Programas Gambas
 
MFC Rect1
MFC Rect1MFC Rect1
MFC Rect1
 
Scala+swing
Scala+swingScala+swing
Scala+swing
 
Gambas
GambasGambas
Gambas
 
Yolygambas
YolygambasYolygambas
Yolygambas
 

Viewers also liked

Educational system in kurdista
Educational system in kurdista Educational system in kurdista
Educational system in kurdista
Mahmoud Ahmed
 
exe in MatLab
exe  in MatLabexe  in MatLab
exe in MatLab
Mahmoud Hikmet
 
Google adsense
Google adsenseGoogle adsense
Google adsense
Mahmoud Hikmet
 
HydroElectricPower seminar
HydroElectricPower seminarHydroElectricPower seminar
HydroElectricPower seminar
Mahmoud Ahmed
 
Tree(Directed and undirected tree)
Tree(Directed and undirected tree)Tree(Directed and undirected tree)
Tree(Directed and undirected tree)
Mahmoud Hikmet
 
Internet Protocol Routing
Internet Protocol RoutingInternet Protocol Routing
Internet Protocol Routing
Mahmoud Hikmet
 
lossy compression JPEG
lossy compression JPEGlossy compression JPEG
lossy compression JPEG
Mahmoud Hikmet
 

Viewers also liked (7)

Educational system in kurdista
Educational system in kurdista Educational system in kurdista
Educational system in kurdista
 
exe in MatLab
exe  in MatLabexe  in MatLab
exe in MatLab
 
Google adsense
Google adsenseGoogle adsense
Google adsense
 
HydroElectricPower seminar
HydroElectricPower seminarHydroElectricPower seminar
HydroElectricPower seminar
 
Tree(Directed and undirected tree)
Tree(Directed and undirected tree)Tree(Directed and undirected tree)
Tree(Directed and undirected tree)
 
Internet Protocol Routing
Internet Protocol RoutingInternet Protocol Routing
Internet Protocol Routing
 
lossy compression JPEG
lossy compression JPEGlossy compression JPEG
lossy compression JPEG
 

Similar to Programming a guide gui

import java.util.Scanner; import java.util.Random; public clas.pdf
import java.util.Scanner; import java.util.Random; public clas.pdfimport java.util.Scanner; import java.util.Random; public clas.pdf
import java.util.Scanner; import java.util.Random; public clas.pdf
annaipowerelectronic
 
ch20.pptx
ch20.pptxch20.pptx
Write Java FX code for this pseudocode of the void initilizaHistoryL.pdf
Write Java FX code for this pseudocode of the void initilizaHistoryL.pdfWrite Java FX code for this pseudocode of the void initilizaHistoryL.pdf
Write Java FX code for this pseudocode of the void initilizaHistoryL.pdf
sales98
 
011 more swings_adv
011 more swings_adv011 more swings_adv
011 more swings_adv
Chaimaa Kabb
 
import javax.swing.; import java.awt.; import java.awt.event..pdf
import javax.swing.; import java.awt.; import java.awt.event..pdfimport javax.swing.; import java.awt.; import java.awt.event..pdf
import javax.swing.; import java.awt.; import java.awt.event..pdf
arwholesalelors
 
Android Event and IntentAndroid Event and Intent
Android Event and IntentAndroid Event and IntentAndroid Event and IntentAndroid Event and Intent
Android Event and IntentAndroid Event and Intent
admin220812
 
Chapter 03 game input
Chapter 03 game inputChapter 03 game input
Chapter 03 game input
boybuon205
 
Java ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdfJava ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdf
atulkapoor33
 
AWT.pptx
AWT.pptxAWT.pptx
AWT.pptx
MumtazAli889808
 
Extracting ui Design - part 5 - transcript.pdf
Extracting ui Design - part 5 - transcript.pdfExtracting ui Design - part 5 - transcript.pdf
Extracting ui Design - part 5 - transcript.pdf
ShaiAlmog1
 
Creating a Facebook Clone - Part XVI.pdf
Creating a Facebook Clone - Part XVI.pdfCreating a Facebook Clone - Part XVI.pdf
Creating a Facebook Clone - Part XVI.pdf
ShaiAlmog1
 
Tic Tac Toe game with GUI written in java.SolutionAnswerimp.pdf
Tic Tac Toe game with GUI written in java.SolutionAnswerimp.pdfTic Tac Toe game with GUI written in java.SolutionAnswerimp.pdf
Tic Tac Toe game with GUI written in java.SolutionAnswerimp.pdf
infomalad
 
UI Design From Scratch - Part 5.pdf
UI Design From Scratch - Part 5.pdfUI Design From Scratch - Part 5.pdf
UI Design From Scratch - Part 5.pdf
ShaiAlmog1
 
Gui programming a review - mixed content
Gui programming   a review - mixed contentGui programming   a review - mixed content
Gui programming a review - mixed content
Yogesh Kumar
 
UI Design From Scratch - Part 5 - transcript.pdf
UI Design From Scratch - Part 5 - transcript.pdfUI Design From Scratch - Part 5 - transcript.pdf
UI Design From Scratch - Part 5 - transcript.pdf
ShaiAlmog1
 
This is the code for the above 5 public class Input extends JFram.pdf
This is the code for the above 5 public class Input extends JFram.pdfThis is the code for the above 5 public class Input extends JFram.pdf
This is the code for the above 5 public class Input extends JFram.pdf
DEEPAKSONI562
 
1) Write a shortsnippetofcodethatcreates a J Panel objectcalled p1, .pdf
1) Write a shortsnippetofcodethatcreates a J Panel objectcalled p1, .pdf1) Write a shortsnippetofcodethatcreates a J Panel objectcalled p1, .pdf
1) Write a shortsnippetofcodethatcreates a J Panel objectcalled p1, .pdf
optokunal1
 
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
Sencha
 
Initial UI Mockup - Part 2.pdf
Initial UI Mockup - Part 2.pdfInitial UI Mockup - Part 2.pdf
Initial UI Mockup - Part 2.pdf
ShaiAlmog1
 
java code please Add event handlers to the buttons in your TicTacToe.pdf
java code please Add event handlers to the buttons in your TicTacToe.pdfjava code please Add event handlers to the buttons in your TicTacToe.pdf
java code please Add event handlers to the buttons in your TicTacToe.pdf
ezzi97
 

Similar to Programming a guide gui (20)

import java.util.Scanner; import java.util.Random; public clas.pdf
import java.util.Scanner; import java.util.Random; public clas.pdfimport java.util.Scanner; import java.util.Random; public clas.pdf
import java.util.Scanner; import java.util.Random; public clas.pdf
 
ch20.pptx
ch20.pptxch20.pptx
ch20.pptx
 
Write Java FX code for this pseudocode of the void initilizaHistoryL.pdf
Write Java FX code for this pseudocode of the void initilizaHistoryL.pdfWrite Java FX code for this pseudocode of the void initilizaHistoryL.pdf
Write Java FX code for this pseudocode of the void initilizaHistoryL.pdf
 
011 more swings_adv
011 more swings_adv011 more swings_adv
011 more swings_adv
 
import javax.swing.; import java.awt.; import java.awt.event..pdf
import javax.swing.; import java.awt.; import java.awt.event..pdfimport javax.swing.; import java.awt.; import java.awt.event..pdf
import javax.swing.; import java.awt.; import java.awt.event..pdf
 
Android Event and IntentAndroid Event and Intent
Android Event and IntentAndroid Event and IntentAndroid Event and IntentAndroid Event and Intent
Android Event and IntentAndroid Event and Intent
 
Chapter 03 game input
Chapter 03 game inputChapter 03 game input
Chapter 03 game input
 
Java ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdfJava ProgrammingImplement an auction application with the followin.pdf
Java ProgrammingImplement an auction application with the followin.pdf
 
AWT.pptx
AWT.pptxAWT.pptx
AWT.pptx
 
Extracting ui Design - part 5 - transcript.pdf
Extracting ui Design - part 5 - transcript.pdfExtracting ui Design - part 5 - transcript.pdf
Extracting ui Design - part 5 - transcript.pdf
 
Creating a Facebook Clone - Part XVI.pdf
Creating a Facebook Clone - Part XVI.pdfCreating a Facebook Clone - Part XVI.pdf
Creating a Facebook Clone - Part XVI.pdf
 
Tic Tac Toe game with GUI written in java.SolutionAnswerimp.pdf
Tic Tac Toe game with GUI written in java.SolutionAnswerimp.pdfTic Tac Toe game with GUI written in java.SolutionAnswerimp.pdf
Tic Tac Toe game with GUI written in java.SolutionAnswerimp.pdf
 
UI Design From Scratch - Part 5.pdf
UI Design From Scratch - Part 5.pdfUI Design From Scratch - Part 5.pdf
UI Design From Scratch - Part 5.pdf
 
Gui programming a review - mixed content
Gui programming   a review - mixed contentGui programming   a review - mixed content
Gui programming a review - mixed content
 
UI Design From Scratch - Part 5 - transcript.pdf
UI Design From Scratch - Part 5 - transcript.pdfUI Design From Scratch - Part 5 - transcript.pdf
UI Design From Scratch - Part 5 - transcript.pdf
 
This is the code for the above 5 public class Input extends JFram.pdf
This is the code for the above 5 public class Input extends JFram.pdfThis is the code for the above 5 public class Input extends JFram.pdf
This is the code for the above 5 public class Input extends JFram.pdf
 
1) Write a shortsnippetofcodethatcreates a J Panel objectcalled p1, .pdf
1) Write a shortsnippetofcodethatcreates a J Panel objectcalled p1, .pdf1) Write a shortsnippetofcodethatcreates a J Panel objectcalled p1, .pdf
1) Write a shortsnippetofcodethatcreates a J Panel objectcalled p1, .pdf
 
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark BrocatoSenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
SenchaCon 2016: Keynote Presentation - Art Landro, Gautam Agrawal, Mark Brocato
 
Initial UI Mockup - Part 2.pdf
Initial UI Mockup - Part 2.pdfInitial UI Mockup - Part 2.pdf
Initial UI Mockup - Part 2.pdf
 
java code please Add event handlers to the buttons in your TicTacToe.pdf
java code please Add event handlers to the buttons in your TicTacToe.pdfjava code please Add event handlers to the buttons in your TicTacToe.pdf
java code please Add event handlers to the buttons in your TicTacToe.pdf
 

Recently uploaded

一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
kecekev
 
Virtual Tour Application Powerpoint for museum of edinburgh
Virtual Tour Application Powerpoint for museum of edinburghVirtual Tour Application Powerpoint for museum of edinburgh
Virtual Tour Application Powerpoint for museum of edinburgh
millarj46
 
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANEEASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
Febless Hernane
 
Connect Conference 2022: Passive House - Economic and Environmental Solution...
Connect Conference 2022: Passive House -  Economic and Environmental Solution...Connect Conference 2022: Passive House -  Economic and Environmental Solution...
Connect Conference 2022: Passive House - Economic and Environmental Solution...
TE Studio
 
Divertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8djDivertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8dj
lunaemel03
 
Game Concept Presentation for Ukrainian Mythology Based Game With Designs
Game Concept Presentation for Ukrainian Mythology Based Game With DesignsGame Concept Presentation for Ukrainian Mythology Based Game With Designs
Game Concept Presentation for Ukrainian Mythology Based Game With Designs
184804
 
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdfSECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
eloprejohn333
 
PDF SubmissionDigital Marketing Institute in Noida
PDF SubmissionDigital Marketing Institute in NoidaPDF SubmissionDigital Marketing Institute in Noida
PDF SubmissionDigital Marketing Institute in Noida
PoojaSaini954651
 
Revolutionizing the Digital Landscape: Web Development Companies in India
Revolutionizing the Digital Landscape: Web Development Companies in IndiaRevolutionizing the Digital Landscape: Web Development Companies in India
Revolutionizing the Digital Landscape: Web Development Companies in India
amrsoftec1
 
International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4
Kyungeun Sung
 
Top Interior Designers in Bangalore.pdf1
Top Interior Designers in Bangalore.pdf1Top Interior Designers in Bangalore.pdf1
Top Interior Designers in Bangalore.pdf1
Decomart Studio
 
Technoblade The Legacy of a Minecraft Legend.
Technoblade The Legacy of a Minecraft Legend.Technoblade The Legacy of a Minecraft Legend.
Technoblade The Legacy of a Minecraft Legend.
Techno Merch
 
Practical eLearning Makeovers for Everyone
Practical eLearning Makeovers for EveryonePractical eLearning Makeovers for Everyone
Practical eLearning Makeovers for Everyone
Bianca Woods
 
CocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdfCocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdf
PabloMartelLpez
 
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdfAHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
talaatahm
 
ARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdfARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdf
Knight Moves
 
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
qo1as76n
 
定制美国西雅图城市大学毕业证学历证书原版一模一样
定制美国西雅图城市大学毕业证学历证书原版一模一样定制美国西雅图城市大学毕业证学历证书原版一模一样
定制美国西雅图城市大学毕业证学历证书原版一模一样
qo1as76n
 
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
k7nm6tk
 
一比一原版(BU毕业证)波士顿大学毕业证如何办理
一比一原版(BU毕业证)波士顿大学毕业证如何办理一比一原版(BU毕业证)波士顿大学毕业证如何办理
一比一原版(BU毕业证)波士顿大学毕业证如何办理
peuce
 

Recently uploaded (20)

一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
一比一原版(UW毕业证)西雅图华盛顿大学毕业证如何办理
 
Virtual Tour Application Powerpoint for museum of edinburgh
Virtual Tour Application Powerpoint for museum of edinburghVirtual Tour Application Powerpoint for museum of edinburgh
Virtual Tour Application Powerpoint for museum of edinburgh
 
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANEEASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
EASY TUTORIAL OF HOW TO USE CAPCUT BY: FEBLESS HERNANE
 
Connect Conference 2022: Passive House - Economic and Environmental Solution...
Connect Conference 2022: Passive House -  Economic and Environmental Solution...Connect Conference 2022: Passive House -  Economic and Environmental Solution...
Connect Conference 2022: Passive House - Economic and Environmental Solution...
 
Divertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8djDivertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8dj
 
Game Concept Presentation for Ukrainian Mythology Based Game With Designs
Game Concept Presentation for Ukrainian Mythology Based Game With DesignsGame Concept Presentation for Ukrainian Mythology Based Game With Designs
Game Concept Presentation for Ukrainian Mythology Based Game With Designs
 
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdfSECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
SECURING BUILDING PERMIT CITY OF CALOOCAN.pdf
 
PDF SubmissionDigital Marketing Institute in Noida
PDF SubmissionDigital Marketing Institute in NoidaPDF SubmissionDigital Marketing Institute in Noida
PDF SubmissionDigital Marketing Institute in Noida
 
Revolutionizing the Digital Landscape: Web Development Companies in India
Revolutionizing the Digital Landscape: Web Development Companies in IndiaRevolutionizing the Digital Landscape: Web Development Companies in India
Revolutionizing the Digital Landscape: Web Development Companies in India
 
International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4
 
Top Interior Designers in Bangalore.pdf1
Top Interior Designers in Bangalore.pdf1Top Interior Designers in Bangalore.pdf1
Top Interior Designers in Bangalore.pdf1
 
Technoblade The Legacy of a Minecraft Legend.
Technoblade The Legacy of a Minecraft Legend.Technoblade The Legacy of a Minecraft Legend.
Technoblade The Legacy of a Minecraft Legend.
 
Practical eLearning Makeovers for Everyone
Practical eLearning Makeovers for EveryonePractical eLearning Makeovers for Everyone
Practical eLearning Makeovers for Everyone
 
CocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdfCocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdf
 
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdfAHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
AHMED TALAAT ARCHITECTURE PORTFOLIO .pdf
 
ARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdfARENA - Young adults in the workplace (Knight Moves).pdf
ARENA - Young adults in the workplace (Knight Moves).pdf
 
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
 
定制美国西雅图城市大学毕业证学历证书原版一模一样
定制美国西雅图城市大学毕业证学历证书原版一模一样定制美国西雅图城市大学毕业证学历证书原版一模一样
定制美国西雅图城市大学毕业证学历证书原版一模一样
 
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
一比一原版(LSBU毕业证书)伦敦南岸大学毕业证如何办理
 
一比一原版(BU毕业证)波士顿大学毕业证如何办理
一比一原版(BU毕业证)波士顿大学毕业证如何办理一比一原版(BU毕业证)波士顿大学毕业证如何办理
一比一原版(BU毕业证)波士顿大学毕业证如何办理
 

Programming a guide gui

  • 1. Programming a GUIDE GUI Prepared by: Mahmoud Hikmet Mostafa Majid
  • 2. Working with Callbacks in GUIDE How to Use the Example Code Push Button Toggle Button Radio Button Check Box Edit Text Slider Topics: List Box Pop-Up Menu Panel Button Group Menu Item Table Axes
  • 5. display( 'Goodbye' ); close(gcf); Push Button Toggle Button button_state = get(hObject, 'Value' ); if button_state == get(hObject, 'Max' ) display( 'down' ); elseif button_state == get(hObject, 'Min' ) display( 'up' ); end
  • 6. Radio Button & Check Box if (get(hObject, 'Value' ) == get(hObject, 'Max' )) display( 'Selected' ); else display( 'Not selected' ); end
  • 7. Edit Text input = get(hObject, 'String' ); display(input); Strings Retrieve Numeric Values input = str2double(get(hObject, 'string' )); if isnan(input) errordlg( 'You must enter a numeric value' , 'Invalid Input' , 'modal' ) uicontrol(hObject) return else display(input); end
  • 8. List Box & Pop-Up Menu items = get(hObject, 'String' ); index_selected = get(hObject, 'Value' ); item_selected = items{index_selected}; display(item_selected);
  • 9. Panel display( 'Mouse button was pressed' ); Resize the Window and Panel By default, GUIDE GUIs cannot be resized, but you can override this behavior by selecting Tools > GUI Options and setting Resize behavior to Proportional. set(hObject, 'Units' , 'Points' ) panelSizePts = get(hObject, 'Position' ); panelHeight = panelSizePts(4); set(hObject, 'Units' , 'normalized' ); newFontSize = 10 * panelHeight / 115; texth = findobj( 'Tag' , 'text1' ); set(texth, 'FontSize' ,newFontSize);
  • 10. Button Group Button groups are similar to panels, but they also manage exclusive selection of radio buttons and toggle buttons. When a button group contains multiple radio buttons or toggle buttons, the button group allows the end user to select only one of them. switch get(eventdata.NewValue,'Tag') case 'radiobutton1' display( 'Radio button 1' ); case 'radiobutton2' display( 'Radio button 2' ); case 'togglebutton1' display( 'Toggle button 1' ); case 'togglebutton2' display( 'Toggle button 2' ); end .
  • 13. • Design the calculator
  • 14. • In the button write this code a= str2num(get(handles.edit1,'string')); b= str2num(get(handles.edit2,'string')); c=a+b; set(handles.text3,'string',c); • In the button write this code a= str2num(get(handles.edit1,'string')); b= str2num(get(handles.edit2,'string')); c=a-b; set(handles.text3,'string',c);
  • 15. • In the button write this code a= str2num(get(handles.edit1,'string')); b= str2num(get(handles.edit2,'string')); c=a*b; set(handles.text3,'string',c); • In the button write this code a= str2num(get(handles.edit1,'string')); b= str2num(get(handles.edit2,'string')); c=a/b; set(handles.text3,'string',c);