making a circular push button

24 views (last 30 days)
Hi every body...
I have a problem with guide...
How can I make a circular push button in gui???
is this problem is related to "position" property????
help me please with this problem...
[Merging information from duplicate question]
really I dont have problem in setting image for push buttons but suppose we want
to set a circular image for a push button...
when you do that the edges of the image becomes black and this is not beutiful for gui
please help me know how to set an image for push buttons with figure background
color and overcome this problem...

Accepted Answer

Walter Roberson
Walter Roberson on 24 Jul 2012
There is no (documented) method of setting a non-square image for a push-button, and there is no (documented) method of setting transparency for the image.
You would need to fetch the uicontrol background color and set the part of the image outside the circle to be that color and then set the CData property to that adjusted image. Which will not make it a circular push button, just a rectangular push button that appears circular.

More Answers (1)

Jan
Jan on 24 Jul 2012
The appearence of the UICONTROLs is controlled by the opreating system. As Walter has said already, you cannot alter it inside Matlab. If you want to use undocumented features, and you should think twice before you do this, look here for a borderless button: Undocumented: Borderless button. You will find other methods there also.
Of course you could use an image instead and its ButtonDownFcn instead of the Callback. Then the ButtonDownFcn is responsible for changng the apperance of the toggled button. This works well, but think twice also: A user-interface is based on the intuitive look-and-feel and fancy buttons usually repell the users and reduce the usability. Remember the dramaticall increase of the frustration level, when MS Office invents the magic read flower on the left top corner - until today nobody knows what this could be useful for.

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!