I’m trying to display one of two separate bitmap
images along with some text. The images are a
check and and a cross symbol and are displayed as
FIRMWARE C
or
FIRMWARE X
or
FIRMWARE
where C would be my checkmark image and X is the
cross image. This is the code I am using to
initially setup the Static bitmap and sizer. This
is then added to a vertical box sizer containing a
few other controls. Lastly for a test, I simply
show the appropriate image as in
@check_sb_firmware.show and @x_sb_firmware forthe
other image. The problem that I am seeing is the
first time I show the image, the image appears at
the top of my panel, the second time I show the
image it is in the correct position, just after my
text. Am I handling this wrong or perhaps there is
a better way? It seems like it should be a simple
task.
Thanks
Mark
def make_firmware_check(parent)
firmware_check_sizer =
Wx::BoxSizer.new(Wx::HORIZONTAL)
check_bm_firmware =
Bitmap.new(“images/check_icon.png”,
Wx::BITMAP_TYPE_ANY)
@check_sb_firmware =
Wx::StaticBitmap.new(parent, -1, check_bm_firmware)
fw_text = Wx::StaticText.new(parent,
ID_SERIAL_STATIC_TEXT, “FIRMWARE”,
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE, 0, “”)
x_bm_firmware =
Bitmap.new(“images/x_icon.png”, Wx::BITMAP_TYPE_ANY)
@x_sb_firmware = Wx::StaticBitmap.new(parent,
-1, x_bm_firmware)
firmware_check_sizer.add(fw_text, 1,
Wx::RIGHT|Wx::TOP|Wx::ALIGN_LEFT, 5)
firmware_check_sizer.add(@check_sb_firmware,
0, Wx::ALIGN_CENTER, 3)
firmware_check_sizer.add(@x_sb_firmware, 0,
Wx::ALIGN_CENTER, 3)
@check_sb_firmware.hide
@x_sb_firmware.hide
return firmware_check_sizer
end