Iconmask, Icon, Inline

Discussion in 'Perl Misc' started by dgoodmaniii@gmail.com, Sep 16, 2012.

  1. Guest

    I tried posting this on comp.lang.perl.tk, but haven't
    gotten an answer for a week or so, so I thought I'd try
    here.

    I'm developing a perl/tk frontend for a small C application
    I wrote (an infix frontend for a command-line postfix
    calculator), and I want to distribute the perl/tk as a
    standalone file without having to package it with the images
    it includes.

    So I converted the image to xbm, then read it into the perl
    source file, assigning it to a variable like so:

    my $icondata = qq(*contents of xbm file*);
    my $iconmaskdata = qq(*contents of mask file, also xbm*);

    I then attempt to use the icon and iconmask methods, like
    so:

    my $icon = $mw->Bitmap(-data=>$icondata);
    my $iconmask = $mw->Bitmap(-data=>$iconmaskdata);
    $mw->iconimage($icon);
    $mw->iconmask($iconmask);

    The "icon" works; I got the blob of black due to the
    transparency not working as expected. But execution fails
    with the iconmask statement included; I get the following
    error:

    bitmap "image1" not defined at /usr/lib/perl5/Tk/Submethods.pm line 37.

    Checking line 37 of that file didn't elucidate things for
    me. When I print the value of $iconmask, I get
    "Tk::Bitmap=HASH(0x943ef58)", which is the same sort of
    thing I get for $icon.

    Using the file I imported into $iconmaskdata with
    "$mw->iconmask('@logo_shapes_mask.xbm');" works perfectly
    as expected, even when the icon is still the imported
    variable rather than the file.

    Can anyone tell me why "$mw->iconimage($icon)" works but
    "$mw->iconmask($iconmask)" doesn't, when I'm using the
    identical assignments for each?

    Also, why does using the mask file directly work, while
    using the identical data in a variable not work?
     
    , Sep 16, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Miro Durcik

    app.rc resource's icon to .net Icon

    Miro Durcik, Oct 9, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    1,426
    Miro Durcik
    Oct 9, 2004
  2. Abhi
    Replies:
    2
    Views:
    763
    E. Robert Tisdale
    Jul 3, 2003
  3. Alvin
    Replies:
    7
    Views:
    506
    E. Robert Tisdale
    May 6, 2005
  4. Dan Polansky
    Replies:
    3
    Views:
    851
    Larry Barowski
    Feb 12, 2007
  5. Bodi
    Replies:
    1
    Views:
    309
    Lasse Reichstein Nielsen
    Nov 18, 2003
Loading...

Share This Page