MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Guide de l'utilisateur Page 549

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 759
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 548
Compose and Code GUIs with Interactive Tools
of colors. The uisetcolor function opens a GUI that returns color values
you can plug into components when you create them or later, by using
set.
For example, the statement:
set(object_handle,'BackgroundColor',uis etcolor)
opens a color selector G U I for you to choose a color. When you click OK,it
returns an RGB color vector that
set assigns immediately. You get an error if
the object does n ot have a property with the specified name or if the specified
property does not accept RGB color values.
You can combine setting position and color into one line of code or one
function, for example:
btn1 = uicontrol('String', 'Button 1',...
'Position',getrect,...
'BackgroundColor',uisetcolor)
When you execute the statement, first getrect executes to let you set a
position using
rbbox. When you release the mouse button, the u isetcolor
GUI opens for you to specify a background color.
11-61
Vue de la page 548
1 2 ... 544 545 546 547 548 549 550 551 552 553 554 ... 758 759

Commentaires sur ces manuels

Pas de commentaire