Tk Source Code

View Ticket
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.
Ticket UUID: 892194
Title: TIP #222 - Windows toplevel transparency (-alpha) option
Type: Support Version: None
Submitter: hobbs Created on: 2004-02-07 00:58:50
Subsystem: None Assigned To: hobbs
Priority: 6 Severity:
Status: Closed Last Modified: 2009-07-29 20:07:06
Resolution: Closed By: hobbs
    Closed on: 2004-10-22 22:45:38
Description:
The attached patch is a demo for Win2K/XP alpha
transparency for entire toplevels.  While cool looking
... it's all relatively useless outside of demos and
splash screens.  I attach it here for reference.  Made
against win/tkWinWm.c of 8.5a0.
User Comments: dkf added on 2009-07-29 20:07:06:

IP - Comment Removed: 130.88.1.31

dkf added on 2008-12-07 19:24:09:

data_type - 212997

das added on 2004-11-11 08:28:42:

File Added - 108378: alphatran-macosx-core-8-4-branch.diff

das added on 2004-11-11 08:28:41:
Logged In: YES 
user_id=90580

implemented [wm attributes -alpha] on Mac OS X and documented it and 
the other attributes on OS X (bug 606665), committed to HEAD and core
-8-4-branch. patch is attached for reference.

hobbs added on 2004-10-23 05:45:38:
Logged In: YES 
user_id=72656

all done.

hobbs added on 2004-09-18 06:37:48:
Logged In: YES 
user_id=72656

Implementation now available in CVS for testing.

hobbs added on 2004-09-18 01:40:31:
Logged In: YES 
user_id=72656

This sample script has a fade out test:

console show
# A start value of 0.99 ensures that we avoid the
# window class switch "blink"
wm attributes . -alpha 0.99

bind . <FocusIn>  { wm attributes . -alpha 0.99 }
bind . <FocusOut> { fade %W 0.99 }

proc fade {w val {min 0.5} {decr 0.03} {delay 50}} {
    catch {after cancel $::ID}
    if {$val > $min} {
set val [expr {$val - $decr}]
wm attributes $w -alpha $val
    }
    set ::ID [after $delay \
  [lreplace [info level 0] 2 2 $val]]
}

hobbs added on 2004-09-18 01:39:34:

File Deleted - 101750: 



File Added - 101865: alphatranwin2.diff

Logged In: YES 
user_id=72656

Updated again to use 0.0 .. 1.0 (opaque default) as the
values.  This aligns with Aqua alpha usage, and enables
generally better granularity.

andreas_kupries added on 2004-09-17 05:42:46:
Logged In: YES 
user_id=75003

This has been proposed to the TCT as "http://tip.tcl.tk/222".

hobbs added on 2004-09-17 03:09:14:

File Deleted - 101646: 



File Added - 101750: alphatranwin2.diff

hobbs added on 2004-09-17 03:09:13:
Logged In: YES 
user_id=72656

Update of my patch to add the tkWinInt.h changes, and with
improvements to reduce calls to UpdateWrapper and use the
right Z order when updating wrapper.

hobbs added on 2004-09-16 07:00:21:

File Added - 101646: alphatranwin2.diff

hobbs added on 2004-09-16 07:00:20:
Logged In: YES 
user_id=72656

An update to the previous patch that creates an alternate
window class style to handle transparent windows.  It
accepts (opaque 0..100 (transparent) as the %age transparent
value.  This should be tipped up for 8.5.  It handles the
cases where layered windows aren't available.

hobbs added on 2004-02-07 07:58:51:

File Added - 75984: alphatranwin.diff

Attachments: