How do I make a gif image my application's icon 
Author Message
 How do I make a gif image my application's icon

I've got a cool gif image that I would like to use as my Tcl/Tk application's icon
(i.e. while my window is iconified).  I am close, but can't quite get it right.  The
code below has the following problems - can someone please give me the right way
to do this (via email preferably)

        Problem 1)  Once icondified, double-clicking anywhere in the gif image
                    does not cause the window to be mapped.  Although, if I carefully
                    position my cursor to the edge of the icon window, double-
                    clicking does work.

        Problem 2)  I would like to be able to move the icon around by selecting
                    anywhere in the icon and using the mouse to reposition.  Again,
                    this only works if on the edge of the image.

Here's the code I am using now:

wm title . "My Window Title"
wm resizable . 1 1
wm iconname . "my_icon"
set icon_image [image create photo -file /opt/SUNWssp/bitmaps/dr_icon.gif]
toplevel .icon
label .icon.image -width 64 -height 50 -image $icon_image
pack .icon.image
wm iconwindow . .icon

In case it matters, I'm running tk4.0 on a Solaris 2.5.1 system, with operwindows.


John Falkenthal                               Voice (619)625-3797
Sun Microsystems                              Fax   (619)625-0641

Sun, 18 Jul 1999 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. does 'making image consistent' harm fixes

2. Adding icons to Window's Application Manager

3. Change Application Icon in MS Windows TCL/Tk application

4. Icon/GIF site - excellent

5. WTD: Fortran makes GIF or JPG

6. howto embed .gif icon file in Tcl script?

7. Best way to draw a GIF toolbar icon?

8. JPEG/GIF in Icon?

9. .gif or .xpm as icon ?

10. Making Icon Stay On Top etc.

11. Generating graphics images (png, gif, ...)

12. Load a gif image into vw (fast)


Powered by phpBB® Forum Software