GUI buttons

2 次查看(过去 30 天)
Razvan
Razvan 2011-9-17
Hi,
I created a GUI with some buttons and I noticed the nice blue color which appears over each button when the mouse is over it. I added to each button some image, with
set(button,'cdata',image);
but now the blue effect is lost when I put the mouse over the buttons. Is there a way to keep this effect after adding an image to a button?
Thanks,
Razvan

采纳的回答

Jan
Jan 2011-9-18
  1 个评论
Razvan
Razvan 2011-9-19
Thanks Jan,
I was able to use the second function, but it has some bugs. If I put 2 buttons next to each other and I move the mouse from one to another, in the end both remain "pushed" (the second image remains active for both).
Thanks though.
Razvan

请先登录,再进行评论。

更多回答(1 个)

Image Analyst
Image Analyst 2011-9-17
Can you have a mouse move callback where it changes the image, with that set() command you used, whenever the mouse moves over the button? One image would have a blue tint. By the way, I don't see a color change - my buttons stay gray no matter if the mouse is over them or not. Maybe it's an operating system feature and you have a different operating system than me.
  1 个评论
Razvan
Razvan 2011-9-18
I use Matlab 2011b in Win 7 SP1 x64. I don't know how to attach a callback for when the mouse is over a button. I only know to attach a callback that starts when the button is pressed...

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by