Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Perl TK changing the logo

by abachus (Monk)
on Dec 14, 2007 at 12:45 UTC ( #657032=perlquestion: print w/replies, xml ) Need Help??

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 poolpi (Hermit) on Dec 14, 2007 at 13:16 UTC
Re: Perl TK changing the logo
by davies (Prior) on Dec 14, 2007 at 16:24 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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://657032]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2022-09-28 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (124 votes). Check out past polls.

    Notices?