Forum: wxRuby How to dynamically change style (Button)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F19a4807544338636bf12e76aff178af?d=identicon&s=25 Jonah Dahlquist (nonybd)
on 2009-06-05 23:10
Hello, world!

How does one go about changing the style of a button after it has
already been made?  Or if there is none, is there some way to highlight
a button?  The button can't be a ToggleButton, it must be a
BitmapButton.

Thanks!
06f6780c99d4a8dd71f2b474082ea9ce?d=identicon&s=25 Alex Fenton (Guest)
on 2009-06-17 12:44
(Received via mailing list)
Hi Jonah

Jonah Dahlquist wrote:
> How does one go about changing the style of a button after it has
> already been made?  Or if there is none, is there some way to highlight
> a button?  The button can't be a ToggleButton, it must be a
> BitmapButton.

I'm not sure exactly what you mean by style - if you just mean the
bitmap that is shown, you can use set_bitmap_label (and also other
set_bitmap_xxx methods for other states like hover, focus) to change the
image that's displayed. Using set_bitmap_focus and set_bitmap_selected
will automatically deal with highlighted images for those states - you
don't need to managed this yourself.

If you need to change the formal "style" argument (eg Wx::BU_AUTODRAW)
then you have to swap two different widgets in and out, and show and
hide them.

alex
This topic is locked and can not be replied to.