Window Icon 
Author Message
 Window Icon

Quote:


> > Hi everyone,

> > I am using UNIX, and when I try to assign a bitmap to the mainwindow's
> > icon, perl gives me an error:

> > format error in bitmap data at /.../Tk/Image.pm line 21.

> > I assume that this means that I am trying to use a bitmap of the wrong
> > variety - what format should it take?

> X11 XBM format, not Win32 BMP format.

> Or use Icon() for a color icon ...

I tried the Icon() thing, but it didn't work with KDE...(no error but no effect)
What is wrong with this code ?

$w_mw->Icon( -image => $w_mw->Pixmap(-file => "xyz.xpm"));

Michael

--
=====================================
Michael Zitzmann                            
Lucent Technologies, Germany          
Dept. FLI16, GSM - BTS SW Development
Thurn-und-Taxis-Str. 10            
90411 Nuernberg                    
Germany                          


Phone : +49 911 526-4065
Fax   : +49 911 526-2048
=====================================



Fri, 05 Jul 2002 03:00:00 GMT  
 Window Icon

Quote:



>> > Hi everyone,

>> > I am using UNIX, and when I try to assign a bitmap to the mainwindow's
>> > icon, perl gives me an error:

>> > format error in bitmap data at /.../Tk/Image.pm line 21.

>> > I assume that this means that I am trying to use a bitmap of the wrong
>> > variety - what format should it take?

>> X11 XBM format, not Win32 BMP format.

>> Or use Icon() for a color icon ...
> I tried the Icon() thing, but it didn't work with KDE...(no error but no effect)

What's "no effect" mean?  Did it iconify w/o the proper Pixmap image?  Or did
it just becomne a button on a task bar?  (I do not use kde.)

Quote:
> What is wrong with this code ?
> $w_mw->Icon( -image => $w_mw->Pixmap(-file => "xyz.xpm"));

Looks OK.  There are various Pixmap versions.  Ensure that, say, xv or gimp
can read the image.  Try xpaint and save a Pixmap and see if that matters.
For that matter, cat the file(s) and see what version they might be...

Or post the file and I'll look at it (-:



Fri, 05 Jul 2002 03:00:00 GMT  
 Window Icon

Quote:



> > I tried the Icon() thing, but it didn't work with KDE...(no error but no effect)

> What's "no effect" mean?  Did it iconify w/o the proper Pixmap image?  Or did
> it just becomne a button on a task bar?  (I do not use kde.)

KDE just has a button on the task bar with a default "dot" icon. I can change
the icon
with the iconbitmap command, but only with a BW bitmap. As e.g. Netscape
generates
its own coloured icon, I thought I could get a coloured icon with the Icon
command.

Quote:

> > What is wrong with this code ?

> > $w_mw->Icon( -image => $w_mw->Pixmap(-file => "xyz.xpm"));

> Looks OK.  There are various Pixmap versions.  Ensure that, say, xv or gimp
> can read the image.  Try xpaint and save a Pixmap and see if that matters.
> For that matter, cat the file(s) and see what version they might be...

> Or post the file and I'll look at it (-:

Well, Tk and xv  don't complain when loading the following xpm:

/* XPM */
static char * monitor_xpm[] = {
"48 48 15 1",
"       s None  c None",
".      c grey64",
"X      c white",
"o      c grey89",
"O      c grey76",
"+      c grey51",

"#      c grey39",
"$      c grey13",
"%      c grey7",
"&      c grey4",
"*      c turquoise4",
"=      c blue4",
"-      c grey26",
";      c green1",
" .............................................  ",
".XoXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXoO. ",
".ooooooooooooooooooooooooooooooooooooOoOOOOOo.+ ",

".XoooooooooooooooooooooooooooooooooOoOOOOOOOO+$ ",

".Xoooo&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&.OOO*$ ",

".Xoooo&##=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#XOOO#% ",

".Xoooo&=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#XOOO#% ",

".Xoooo&##=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=-XO.O#% ",

".Xoooo&=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=-XO..#% ",
".Xoooo&#=XX#XXXX=XXXXX=XXXXX=#=#=#=#=#=#-X...=% ",
".Xoooo&=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=-X...#% ",
".Xoooo&#=XXXXX=#=#=#=#=#=#=#=#=#=#=#=#=#-X...#& ",
".Xoooo&=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=-X...#% ",
".Xoooo&#=XX#=#=#=#=#=#=#=#=#=#=#=#=#=#=#-X...#& ",

".Xoooo&#=XXXX#XX=XXX=#=#=#=#=#=#=#=#=#=#-X...#& ",
".Xoooo&=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=-X...#& ",
".Xoooo&#=XXX=XXXX#=XXXX#=#=#=#=#=#=#=#=#-X...#& ",
".Xoooo&=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=-X...#& ",
".Xoooo&#=XX#=#=#=#=#=#=#=#=#=#=#=#=#=#=#-X...#& ",
".Xoooo&=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=-X..+#& ",
".Xoooo&#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#-X..+#& ",
".Xoooo&=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=-X+++#& ",
".Xoooo&#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#-X+++-& ",
".Xoooo&##=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#=#X+++-& ",

".Xoooo.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX+++-& ",
".XoooooOoOOOOOOOOOOOOO................---++++-& ",
".XoooOoOOOOOOOOOOOOOO...............++-;;O+++-& ",
".XoooOOOOOOOOOOOOOOO................+++OOO+++-& ",

".*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ",
"          .X#----$OO..+##--$$%%%$$---           ",
"         .X.######-#+*+##---%$$--####$          ",
"        .Xo++++++++##---------#++++++#$         ",
"       .XX............................#$        ",
"      .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#$       ",
"      .X................................&       ",
"      .X................................&       ",
"       #&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&        ",
"                                                ",
"                                                "};

regards

Michael



Sat, 13 Jul 2002 03:00:00 GMT  
 Window Icon

Quote:




> > > I tried the Icon() thing, but it didn't work with KDE...(no error but no effect)

> > What's "no effect" mean?  Did it iconify w/o the proper Pixmap image?  Or did
> > it just becomne a button on a task bar?  (I do not use kde.)

> KDE just has a button on the task bar with a default "dot" icon. I can change
> the icon
> with the iconbitmap command, but only with a BW bitmap. As e.g. Netscape
> generates
> its own coloured icon, I thought I could get a coloured icon with the Icon
> command.

> > > What is wrong with this code ?

> > > $w_mw->Icon( -image => $w_mw->Pixmap(-file => "xyz.xpm"));

> > Looks OK.  There are various Pixmap versions.  Ensure that, say, xv or gimp
> > can read the image.  Try xpaint and save a Pixmap and see if that matters.
> > For that matter, cat the file(s) and see what version they might be...

> > Or post the file and I'll look at it (-:

> Well, Tk and xv  don't complain when loading the following xpm:

Just a few guesses (looking at a colored Tk icon using KDE...):
* try a photo (gif, ppm, ...) instead of a pixmap
* try a smaller icon

Regards,
        Slaven

--
use Tk;$c=tkinit->Canvas(-he,20)->grid;$x=5;map{s!\n!!g;map{create$c 'line'=>
map{$a=-43+ord;($x+($a>>3)*2=>5+($a&7)*2)}split''}split"!";$x+=12}split/_/=>'K
PI1_+09IPK_K;-OA1_+K!;A__1;Q!7G_1+QK_3CLPI90,_+K!;A_+1!KQ!.N_K+1Q!.F_1+KN.Q__1+
KN._K+1Q!.F_1+KN.Q_+1Q__+1!KQ!.N_1;Q!7G_K3,09Q_+1!K.Q_K+1Q!.F_1+KN.Q_';MainLoop



Sat, 13 Jul 2002 03:00:00 GMT  
 Window Icon

Quote:

> Just a few guesses (looking at a colored Tk icon using KDE...):
> * try a photo (gif, ppm, ...) instead of a pixmap
> * try a smaller icon

tried both, the loaded photo (a really tiny gif) showed up properly
in a button, but not as icon for the main window ...


Sun, 14 Jul 2002 03:00:00 GMT  
 Window Icon

Quote:


> > Just a few guesses (looking at a colored Tk icon using KDE...):
> > * try a photo (gif, ppm, ...) instead of a pixmap
> > * try a smaller icon

> tried both, the loaded photo (a really tiny gif) showed up properly
> in a button, but not as icon for the main window ...

I think this is probably a version problem. I tried your icon with:
- perl5.00503
- Tk800.018 (but 800.015 should work too, but not older versions)
- KDE 1.1.2
- FreeBSD 3.4
and it worked.

Regards,
        Slaven

--
use Tk;$c=tkinit->Canvas(-he,20)->grid;$x=5;map{s!\n!!g;map{create$c 'line'=>
map{$a=-43+ord;($x+($a>>3)*2=>5+($a&7)*2)}split''}split"!";$x+=12}split/_/=>'K
PI1_+09IPK_K;-OA1_+K!;A__1;Q!7G_1+QK_3CLPI90,_+K!;A_+1!KQ!.N_K+1Q!.F_1+KN.Q__1+
KN._K+1Q!.F_1+KN.Q_+1Q__+1!KQ!.N_1;Q!7G_K3,09Q_+1!K.Q_K+1Q!.F_1+KN.Q_';MainLoop



Sun, 14 Jul 2002 03:00:00 GMT  
 Window Icon

Quote:

> I think this is probably a version problem. I tried your icon with:
> - perl5.00503
> - Tk800.018 (but 800.015 should work too, but not older versions)
> - KDE 1.1.2
> - FreeBSD 3.4
> and it worked.

Yep, after installing Tk800.018 (Tk800.007 before) it works !!

Thanks a lot

Michael



Fri, 19 Jul 2002 03:00:00 GMT  
 Window Icon
does this group have an archive? where?

thanks,

tom arnall
accokeek, md



Fri, 02 Aug 2002 03:00:00 GMT  
 Window Icon

Quote:

> does this group have an archive? where?

http://www.lehigh.edu/sol0/ptk

I try to make sure *this* address always has pointers to all things Perl/Tk,
including the archive and FAQs. While my emphasis is on Perl/Tk, I include
a pointer to the Tcl/Tk FAQ, which is *the* definitive reference for *all*
things Tk (a huge thanks to Larry Virden), including pointers to even more
Perl/Tk stuff.



Fri, 02 Aug 2002 03:00:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. Image::Magick to write Windows icons

2. Windows Icon for Perl?

3. How to define the main window icon - how to deal with bitmaps

4. Main Window Icon

5. Resizable and Tk Window Icon

6. Replacing Window Icon Bitmap

7. Window Icon

8. WIN32: Window Icon

9. Win32 window icon

10. Window Icon

11. Setting the main window icon in Perl/Tk for Win32

 

 
Powered by phpBB® Forum Software