Forum: wxRuby static bitmap - set_bitmap

Posted by 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?
Posted by Alessandro Barracco (bomastudio)
on 2011-01-04 09:15
up
Posted by 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
Posted by 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
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.