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:
GUIDE pushbutton: How to remove outline?

Subject: GUIDE pushbutton: How to remove outline?

From: Joel

Date: 17 Jun, 2011 17:39:04

Message: 1 of 8

I am making a GUI using GUIDE. I want to know how to make a pushbuttton object, NOT have an outline. I think the proper term for this might be the "shadow".

PropertyInspector does not list anyting like 'edgecolor', 'LineStyle', 'Shadow' etc that one would think controlled this feature. I can see that some of the other GUIDE elements DO have a shadow property, but not the pushbutton.


An alternate solution that could work for me is to make a button that is entirely clear / invisible. I looked at the background color property and "none" was not a choice.

Any ideas?

Subject: GUIDE pushbutton: How to remove outline?

From: matt dash

Date: 17 Jun, 2011 19:43:04

Message: 2 of 8

"Joel" wrote in message <itg3fo$sgf$1@newscl01ah.mathworks.com>...
> I am making a GUI using GUIDE. I want to know how to make a pushbuttton object, NOT have an outline. I think the proper term for this might be the "shadow".
>
> PropertyInspector does not list anyting like 'edgecolor', 'LineStyle', 'Shadow' etc that one would think controlled this feature. I can see that some of the other GUIDE elements DO have a shadow property, but not the pushbutton.
>
>
> An alternate solution that could work for me is to make a button that is entirely clear / invisible. I looked at the background color property and "none" was not a choice.
>
> Any ideas?

I'm a little curious of what the point of making an invisible button would be... but regardless, it happens that Yair Altman just wrote an article about this very issue:
http://undocumentedmatlab.com/blog/borderless-button-used-for-plot-properties/

Subject: GUIDE pushbutton: How to remove outline?

From: Joel

Date: 17 Jun, 2011 20:37:05

Message: 3 of 8

I did see that article. And that is what I want to do, but I don't want to make a java button. I want to do it with a uicontrol button.

The reason is that I want to record where users click on the screen and response differently based on where they click; without having a visible target.

Subject: GUIDE pushbutton: How to remove outline?

From: matt dash

Date: 17 Jun, 2011 22:01:04

Message: 4 of 8

"Joel" wrote in message <itgdth$1qq$1@newscl01ah.mathworks.com>...
> I did see that article. And that is what I want to do, but I don't want to make a java button. I want to do it with a uicontrol button.
>
> The reason is that I want to record where users click on the screen and response differently based on where they click; without having a visible target.

uicontrol buttons are java buttons... it's just a different command that makes them. But it sounds like what you really want might be just a figure buttondownfcn, then use get(gcf,'currentpoint').

Subject: GUIDE pushbutton: How to remove outline?

From: ImageAnalyst

Date: 18 Jun, 2011 00:13:43

Message: 5 of 8

On Jun 17, 4:37 pm, "Joel" <espos...@usna.edu> wrote:
> I did see that article.    And that is what I want to do, but I don't want to make a java button.   I want to do it with a uicontrol button.
>
> The reason is that I want to record where users click on the screen and response differently based on where they click; without having a visible target.

--------------------------------------
Why not use an axes control and use ginput to find where they clicked?

Subject: GUIDE pushbutton: How to remove outline?

From: Yair Altman

Date: 19 Jun, 2011 11:53:04

Message: 6 of 8

"matt dash" wrote in message <itgir0$eo8$1@newscl01ah.mathworks.com>...
> "Joel" wrote in message <itgdth$1qq$1@newscl01ah.mathworks.com>...
> > I did see that article. And that is what I want to do, but I don't want to make a java button. I want to do it with a uicontrol button.
> >
> > The reason is that I want to record where users click on the screen and response differently based on where they click; without having a visible target.
>
> uicontrol buttons are java buttons... it's just a different command that makes them. But it sounds like what you really want might be just a figure buttondownfcn, then use get(gcf,'currentpoint').


Customization of uicontrol buttons, including the issue of changing or removing the border, was discussed here: http://UndocumentedMatlab.com/blog/button-customization/

Yair Altman
http;//UndocumentedMatlab.com

Subject: GUIDE pushbutton: How to remove outline?

From: ImageAnalyst

Date: 19 Jun, 2011 13:14:40

Message: 7 of 8

So you think the best way to determine where the users click on the
screen is to have a gigantic button the size of the entire screen and
somehow determine where they clicked on the button??? Why is this
better than having an axes and using something like ginput to
determine where they clicked like I suggested? I mean, axes are meant
for that, and buttons aren't - that's not the main function of a
button.

Subject: GUIDE pushbutton: How to remove outline?

From: Yair Altman

Date: 19 Jun, 2011 13:46:04

Message: 8 of 8

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <98a5970d-af1e-45fe-9838-a90d11d0eaf8@v10g2000yqn.googlegroups.com>...
> So you think the best way to determine where the users click on the
> screen is to have a gigantic button the size of the entire screen and
> somehow determine where they clicked on the button??? Why is this
> better than having an axes and using something like ginput to
> determine where they clicked like I suggested? I mean, axes are meant
> for that, and buttons aren't - that's not the main function of a
> button.


ImageAnalyst - you're rushing into an open door. Of course I agree with you that there are better ways to determine where a user clicked. I'm surprised you'd think otherwise, knowing me as you do...

In my answer above, I merely answered the specific question of how to remove a uicontrol's borders. Then again, I guess I could have clarified my answer a bit more, to emphasize this point.

Yair Altman
http;//UndocumentedMatlab.com

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