Bitmaps use xbm files. Here's an example using betty_boop.xbm:
#! /usr/local/bin/perl use strict; use warnings; use Tk; my $mw = MainWindow->new(); my $b = $mw->Bitmap( -file => '/path/to/betty_boop.xbm', -foreground => 'black', -background => 'white', ); my $l = $mw->Label( -image => $b, -background => 'gray')->pack; MainLoop;
And here's betty_boop.xbm
#define betty_boop_width 20 #define betty_boop_height 20 static unsigned char betty_boop_bits[] = { 0x20, 0x00, 0x00, 0xe0, 0xff, 0x00, 0xf8, 0xff, 0x01, 0xfc, 0xff, 0 +x03, 0xfc, 0xff, 0x07, 0xfc, 0xff, 0x07, 0x7c, 0x43, 0x03, 0xbe, 0xc1, 0 +x03, 0x9f, 0x40, 0x06, 0x3c, 0x63, 0x03, 0x98, 0xf7, 0x02, 0xb8, 0xb5, 0 +x03, 0xb8, 0x94, 0x02, 0xb8, 0xe3, 0x01, 0x38, 0x08, 0x03, 0x38, 0x1c, 0 +x01, 0xe0, 0xff, 0x00, 0xf0, 0x60, 0x00, 0x78, 0x40, 0x00, 0xb0, 0x58, 0 +x00};
Or use whatever xbm that you want.

In reply to Re: tk Menubutton question by Khen1950fx
in thread tk Menubutton question by remling

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.