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

hello I would like to add my logo in TKX (like the "e" to the left of the internet explorer in top most blue bar) I would like to do such a thing in Perl/TKX guis. Is there a way to do it? Plz let me know. thx

Replies are listed 'Best First'.
Re: Adding my logo in TKX
by zentara (Cardinal) on Dec 19, 2009 at 14:51 UTC
    .... this stuff works on Tk, should point the way to Tkx....see Tk oddity with Label, iconbitmap and listbox and check out this code
    #!/usr/bin/perl use warnings; use strict; use Tk; # by Ch Lambrecht my $logo = <<'logo_end'; /* XPM */ static char * logo_xpm[] = { "32 32 5 1", " c None", ". c #FD000A", "+ c #FD6463", "@ c #FEBEBE", "# c #FEFFFC", "################################", "################################", "################################", "################################", "################################", "################################", "################################", "################################", "################################", "########........##.....@########", "#########@....+####@.###########", "##########+....@###.@###########", "###########.....##++############", "###########@....+@.#############", "############+.....@#############", "#############.....##############", "#############@....@#############", "#############@.....#############", "#############.+....+############", "############++#+....@###########", "###########@.###.....###########", "###########.@###@....+##########", "##########++#####+....@#########", "########+....###........########", "################################", "################################", "################################", "################################", "################################", "################################", "################################", "################################"}; logo_end ; package Tk::Toplevel; sub InitObject{ my ($self,$args) = @_; $self->SUPER::InitObject($args); my $mw = $self; while ($mw->parent){$mw = $mw->parent} if ($mw->cget('-appicon')){ $self->afterIdle(sub{$self->iconimage($mw->cget('-appicon'))} +) ; } } package MainWindow; sub Populate{ my ($self,$args) = @_; $self->SUPER::Populate($args); $self->ConfigSpecs(-appicondata => ['METHOD'], -appiconfile => ['METHOD'], -appicon => ['PASSIVE'] ); $self->configure(%$args); } sub appicondata{ my $self = shift; $self->configure(-appicon => $self->Pixmap(-data=>$_[0])); } sub appiconfile{ my $self = shift; $self->configure('-appicon' => $self->Pixmap(-file=>$_[0])); } package main; #my $mw = MainWindow->new(-appiconfile => 'logo.xpm'); my $mw = MainWindow->new(-appicondata => $logo); $mw->Toplevel(); my $tp = $mw->Toplevel(); MainLoop;

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku
Re: Adding my logo in TKX
by Anonymous Monk on Dec 19, 2009 at 08:19 UTC