http://qs1969.pair.com?node_id=657032

abachus has asked for the wisdom of the Perl Monks concerning the following question:

Good day ye monks,

I have one simple question, when using TK (in this case on Win32 platforms) on the far left of the title bar sits a 'Tk' logo. I ask, how is it possible to change this to another logo of ones own choice ?

many thanks,

Isaac Close

Replies are listed 'Best First'.
Re: Perl TK changing the logo
by zentara (Archbishop) on Dec 14, 2007 at 14:09 UTC
    This works on linux.
    #!/usr/bin/perl use Tk; my $mw = tkinit; my $image = 'z-icon.gif'; # 32x32 GIF or BMP my $icon = $mw->Photo(-file => $image); $mw->idletasks; # this line is crucial $mw->iconimage($icon); MainLoop;

    I'm not really a human, but I play one on earth. Cogito ergo sum a bum
      #!/usr/bin/perl use Tk; my $mw = tkinit; my $image = 'z-icon.gif'; # 32x32 GIF or BMP my $icon = $mw->Photo(-file => $image); $mw->idletasks; # this line is crucial $mw->iconimage($icon); MainLoop;
      In this how to add to increase the dimension of the gif file?
      Am using 200x200 gif file
        Resize the 200x200 gif to 32x32 first. Icons need to be 32x32, unless a module does it automatically for you.

        I'm not really a human, but I play one on earth.
        Old Perl Programmer Haiku ................... flash japh
Re: Perl TK changing the logo
by davies (Prior) on Dec 14, 2007 at 16:24 UTC
Re: Perl TK changing the logo
by poolpi (Hermit) on Dec 14, 2007 at 13:16 UTC
Re: Perl TK changing the logo
by lamprecht (Friar) on Oct 26, 2010 at 11:24 UTC
    Hi,

    here is a small addon: Load once and get the Icon for every Toplevel.

    usage:
    use strict; use warnings; use Tk; use Tk::ToplevelIcon; tkinit; MainLoop;

    Cheers, Chris