in reply to How do I set the main window icon in Tkx?

To load a color image from a file for the icon:

my $mw = Tkx::widget->new('.'); my $img = Tkx::image_create_photo(-file => 'icon.gif'); $mw->g_wm_iconphoto($img);

If you have embedded data to use instead of a file (note the -data instead of -file in create_photo):

#Pack hardcoded GIF bytes: my $icon = pack('C*' ,71,73,70,56,57,97,64,0,64,0,247,0,0,84,186, ... my $mw = Tkx::widget->new('.'); my $img = Tkx::image_create_photo(-data => $icon); $mw->g_wm_iconphoto($img);