Forum: wxRuby static bitmap - set_bitmap

E23087687a1dc09800922263cf1774c0?d=identicon&s=25 Alessandro Barracco (bomastudio)
on 2011-01-03 12:07
Hi all,
 I need to change at runtime the bitmap label of a Static Bitmap
control.
I use this code:

def change_img_at_click
   img = File.join(File.dirname(__FILE__), "/immagini/03_muro_RETT.png")
   @m_bitmap1.set_bitmap(Wx::Bitmap.new(img))
end

It works good, but every click the new image translate upward.... why?
E23087687a1dc09800922263cf1774c0?d=identicon&s=25 Alessandro Barracco (bomastudio)
on 2011-01-04 09:15
up
06f6780c99d4a8dd71f2b474082ea9ce?d=identicon&s=25 Alex Fenton (Guest)
on 2011-01-06 16:04
(Received via mailing list)
On 03/01/2011 11:07, Alessandro Barracco wrote:
>   I need to change at runtime the bitmap label of a Static Bitmap
> control.
> I use this code:
>
> def change_img_at_click
>     img = File.join(File.dirname(__FILE__), "/immagini/03_muro_RETT.png")
>     @m_bitmap1.set_bitmap(Wx::Bitmap.new(img))
> end
>
> But avery click the new image translate upward.... why?

Looks OK. Are the images the same size?

I don't remember needing to do this, but you might try calling
sizer.layout on the containing sizer

a
06f6780c99d4a8dd71f2b474082ea9ce?d=identicon&s=25 Alex Fenton (Guest)
on 2011-01-06 16:36
(Received via mailing list)
On 04/01/2011 08:15, Alessandro Barracco wrote:
> up
>
PS - please don't do this. You might think you're looking at a forum,
but this is primarily a mailing list which a third party mirrors onto a
forum. This kind of message is annoying to the m.l. users.

Happy to help in the future, but you may find you get a quicker response
if you provide more detail about what you're trying to do, what you
expected to happen that didn't, and a complete, simplified runnable
sample.

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