Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
GUI interconnect toggle buttons

Subject: GUI interconnect toggle buttons

From: Daphne

Date: 25 Dec, 2007 20:51:08

Message: 1 of 4


I am building a complex GUI to control a microscope system
with several functions. The plan is to use toggle buttons
to choose, for example, different objective lenses. How
can I "connect" a few buttons so that only one of them may
be active at a time?

A smaller, related issue, how can I change the appearance
or color of the pressed button so that it is very clear
which one is activated? The default change is not dramatic
enough and needs to be very clear...

Thanks,
Daphne

Subject: GUI interconnect toggle buttons

From: Stephan Hoffmann

Date: 25 Dec, 2007 22:00:23

Message: 2 of 4

"Daphne " <daphnew_too_nospam@yahoo.com> wrote in message
<fkrqfs$oqt$1@fred.mathworks.com>...
>
> I am building a complex GUI to control a microscope system
> with several functions. The plan is to use toggle buttons
> to choose, for example, different objective lenses. How
> can I "connect" a few buttons so that only one of them may
> be active at a time?
>
> A smaller, related issue, how can I change the appearance
> or color of the pressed button so that it is very clear
> which one is activated? The default change is not dramatic
> enough and needs to be very clear...
>
> Thanks,
> Daphne


You could do it manually. You can set the toggle status of
each button by set(handles.TAG,'Value',1) or
set(handles.TAG,'Value',0).
With set(handles.TAG,'BackgroundColor',[r g b]) you are able
to change the color of a button.


Regards,
Stephan Hoffmann

Subject: GUI interconnect toggle buttons

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 26 Dec, 2007 00:27:10

Message: 3 of 4

In article <fkrqfs$oqt$1@fred.mathworks.com>,
Daphne <daphnew_too_nospam@yahoo.com> wrote:

>I am building a complex GUI to control a microscope system
>with several functions. The plan is to use toggle buttons
>to choose, for example, different objective lenses. How
>can I "connect" a few buttons so that only one of them may
>be active at a time?

uibuttongroup()
--
  "Is there any thing whereof it may be said, See, this is new? It hath
  been already of old time, which was before us." -- Ecclesiastes

Subject: GUI interconnect toggle buttons

From: turtie

Date: 26 Dec, 2007 08:12:33

Message: 4 of 4

Try this tutorial. It covers what you want to do.

http://www.blinkdagger.com/matlab/matlab-gui-tutorial-buttons-button-group

Good luck!

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us