Static bitmap - set_bitmap

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?

up

On 03/01/2011 11:07, Alessandro B. 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

On 04/01/2011 08:15, Alessandro B. 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