git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitk: try to provide a window icon
@ 2008-12-28 11:28 Giuseppe Bilotta
  0 siblings, 0 replies; 2+ messages in thread
From: Giuseppe Bilotta @ 2008-12-28 11:28 UTC (permalink / raw)
  To: git; +Cc: Paul Mackerras, Junio C Hamano, Giuseppe Bilotta

Try to set up a 16x16 Tk photo image (based on the git logo) and use it
as window icon. Wrap the code in a catch because it may fail in earlier
Tcl/Tk 8.4 releases that don't provide 'wm iconphoto'.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
---

Resend (with a typo fixed in the commit message), because it seems to
have flied a little too low on the previous round of commits.

 gitk-git/gitk |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/gitk-git/gitk b/gitk-git/gitk
index dc2a439..8c6a50d 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -10881,6 +10881,26 @@ set lserial 0
 set isworktree [expr {[exec git rev-parse --is-inside-work-tree] == "true"}]
 setcoords
 makewindow
+catch {
+	image create photo gitlogo      -width 16 -height 16
+
+	image create photo gitlogominus -width  4 -height  2
+	gitlogominus put #C00000 -to 0 0 4 2
+	gitlogo copy gitlogominus -to  1 5
+	gitlogo copy gitlogominus -to  6 5
+	gitlogo copy gitlogominus -to 11 5
+	image delete gitlogominus
+
+	image create photo gitlogoplus  -width  4 -height  4
+	gitlogoplus  put #008000 -to 1 0 3 4
+	gitlogoplus  put #008000 -to 0 1 4 3
+	gitlogo copy gitlogoplus  -to  1 9
+	gitlogo copy gitlogoplus  -to  6 9
+	gitlogo copy gitlogoplus  -to 11 9
+	image delete gitlogoplus
+
+	wm iconphoto . -default gitlogo
+}
 # wait for the window to become visible
 tkwait visibility .
 wm title . "[file tail $argv0]: [file tail [pwd]]"
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread
* Re: [PATCH] gitk: try to set program icon
@ 2008-11-16  2:14 Giuseppe Bilotta
  2008-11-16  2:41 ` [PATCH] gitk: try to provide a window icon Giuseppe Bilotta
  0 siblings, 1 reply; 2+ messages in thread
From: Giuseppe Bilotta @ 2008-11-16  2:14 UTC (permalink / raw)
  To: git; +Cc: Paul Mackerras, Junio C Hamano, Giuseppe Bilotta

On Sun, Nov 16, 2008 at 12:45 AM, Giuseppe Bilotta
<giuseppe.bilotta@gmail.com> wrote:
> We add the git icon in three formats (.xbm, .ico, .ppm), which we try to
> set as window icon.

[snip]

Scratch this. I've seen how it's done in git-gui, and I think that's a
better way to do it. I've provided a patch for git-gui to introduce
the icon under X, so I'll just use something like that, maybe using wm
iconphoto for all platforms.

-- 
Giuseppe "Oblomov" Bilotta

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-28 11:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-28 11:28 [PATCH] gitk: try to provide a window icon Giuseppe Bilotta
  -- strict thread matches above, loose matches on Subject: below --
2008-11-16  2:14 [PATCH] gitk: try to set program icon Giuseppe Bilotta
2008-11-16  2:41 ` [PATCH] gitk: try to provide a window icon Giuseppe Bilotta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).