I'm trying to use an image in a Wx::Grid app but can't seem to find my problem. I've posted my sample code below:
use Wx qw(:everything); ####################################### # package MyApp; # ####################################### use strict; use vars qw(@ISA); @ISA = qw(Wx::App); sub OnInit { my($this) = @_; my($frame) = MyFrame->new( undef, -1, "Image Test", [-1,-1], [640, + 340]); $frame->CenterOnScreen; $frame->Show(1); $this->SetTopWindow($frame); return 1; } ####################################### # package MyFrame; # ####################################### use strict; use vars qw(@ISA); @ISA = qw(Wx::Frame); use Wx qw(:everything); use Wx::Event qw(:everything); use Wx::Grid; Wx::InitAllImageHandlers(); sub new { my( $class ) = shift; my( $this ) = $class->SUPER::new( @_ ); $this->{main_window} = $this; my $grid = Wx::Grid->new($this, -1, [ 10 , 70 ], [ 250, 250 ]); $grid->SetFont(Wx::Font->new(8, wxDEFAULT, wxNORMAL, wxNORMAL, 0, +"")); $grid->CreateGrid(5, 5); $grid->SetRowLabelSize(20); for (0..4) { $grid->SetColLabelValue($_, "Col $_"); } $grid->SetColLabelValue(4, "Col 5"); my $ok_image = 'C:\\Test\\check_mark.png'; $grid->SetCellValue( 3, 3, Wx::Bitmap->new("$ok_image", wxBITMAP_T +YPE_ANY)); EVT_GRID_CMD_CELL_LEFT_CLICK( $this, $grid, sub{print "Changing im +age ...\n";}); return $this; } package main; my($app) = MyApp->new(); $app->MainLoop();
Does anyone have any idea why this isn't working?

In reply to Using an image in Wx::Grid by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.