making a circular push button

Asked by mohammad asasi on 24 Jul 2012
Latest activity Commented on by mohammad asasi on 28 Jul 2012

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...

0 Comments

mohammad asasi

Products

No products are associated with this question.

2 Answers

Answer by Walter Roberson on 24 Jul 2012
Accepted answer

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.

1 Comment

mohammad asasi on 28 Jul 2012

thanks walter

Walter Roberson
Answer by Jan Simon 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.

1 Comment

mohammad asasi on 28 Jul 2012

thanks jan

Jan Simon

Contact us