Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Irregular-shaped windows?

193 views
Skip to first unread message

hellomo...@yahoo.com

unread,
Apr 5, 2004, 4:01:17 AM4/5/04
to
I have seen some applications that make use of irregular shaped
windows - like WinDVD player gui that looks oval-shaped. It also
looks transparent and doesn't have the typical window manager frame
that encircles every other window. (I think this last point could be
addressed with wm overrideredirect option, though.)

So, my questions are if the following kind of things would be possible
in TK.

1) Non-rectangular shaped windows
2) No decoration by window managers
3) Transparent windows

Has anyone done similar things?

Victor Wagner

unread,
Apr 5, 2004, 4:49:15 AM4/5/04
to
hellomo...@yahoo.com wrote:
: I have seen some applications that make use of irregular shaped

: windows - like WinDVD player gui that looks oval-shaped. It also
: looks transparent and doesn't have the typical window manager frame
: that encircles every other window. (I think this last point could be
: addressed with wm overrideredirect option, though.)

: So, my questions are if the following kind of things would be possible
: in TK.

: 1) Non-rectangular shaped windows

See shape extension by Donal Fellows
(http://www.cs.man.ac.uk/~fellowsd/tcl/shapeidx.html)

: 2) No decoration by window managers

Overrideredirect does help, but it is quite dangerous. I prefer to use
window-manager specific ways to undecorate windows.

: 3) Transparent windows

Can be achieved using shape extension, but cost much in terms of network
traffic. Better ways would be available when alpha channel support
extensions to X11 protocol would be avaliable.


--

Donal K. Fellows

unread,
Apr 5, 2004, 10:19:25 AM4/5/04
to
hellomo...@yahoo.com wrote:
> 1) Non-rectangular shaped windows

Requires an extension, but is believed to be supportable on every
platform that Tk works on. Start looking at http://wiki.tcl.tk/6229

> 2) No decoration by window managers

Trivial. Do:
wm overrideredirect .the.toplevel.window 1
immediately after creating the window.

> 3) Transparent windows

What platform are you on, and what exactly do you mean by "transparent"?
(I've seen a few different interpretations!)

Donal.

Tom Krehbiel

unread,
Apr 5, 2004, 10:48:38 AM4/5/04
to

Andreas Leitgeb

unread,
Apr 5, 2004, 11:08:21 AM4/5/04
to
Donal K. Fellows <donal.k...@man.ac.uk> wrote:
>> 2) No decoration by window managers
> Trivial. Do:
> wm overrideredirect .the.toplevel.window 1
> immediately after creating the window.

It's not *that* trivial, because the overrideredirect makes
the window completely unknown to the wm.

Often one rather needs a window that behaves like xmms's main
window (no wm-title-bars and frames, but the wm still knows
about it; one can Alt-Tab to set the focus on it or from it,
and there is an icon in the taskbar, that correctly reflects
the current state(minimized/normal) etc, etc, etc.). I don't
see how one can get to this behaviour with wm overrideredirect...

Gerard Sookahet

unread,
Apr 5, 2004, 11:59:57 AM4/5/04
to
hellomo...@yahoo.com wrote:
> I have seen some applications that make use of irregular shaped
> windows - like WinDVD player gui that looks oval-shaped. It also
> looks transparent and doesn't have the typical window manager frame
> that encircles every other window. (I think this last point could be
> addressed with wm overrideredirect option, though.)
>
[....]

>
> 2) No decoration by window managers

Here is an example: http://www.pragana.net/skin.html

HTH

GS

Donal K. Fellows

unread,
Apr 5, 2004, 3:38:30 PM4/5/04
to
Andreas Leitgeb wrote:

> It's not *that* trivial, because the overrideredirect makes
> the window completely unknown to the wm.


Ah. That type of notion of undecorated. It requires real cooperation
from the WM to achieve, and isn't currently supported in the core. I've
not read the specs on how to do this; the ICCCM is quite a bit clearer (!)
than some of the documents on extensions to the WM-client protocols, too
many of which are written in a style that reminds me of Motif for sheer
opacity...

I bet it isn't hard to do though. Just set the right property. It can't
be too difficult on the other platforms either.

If I was doing this in the core, I'd do it in the [wm attributes] command.

Donal.

freemnem...@gmail.com

unread,
Oct 5, 2012, 10:48:03 AM10/5/12
to
Hi, Been trying to do the same stuff. This works wonderfully in Tool Command Language 'Tcl' for making an application transparent, Lets do like a 35:


wm attributes . -alpha .35 -topmost 1
set AlphaLevel 0.35

I should credit the Wiki site but I can't find the little transparency slider source I got it from, good luck on the skins.

Donal K. Fellows

unread,
Oct 7, 2012, 11:11:31 AM10/7/12
to
On 05/10/2012 15:48, freemnem...@gmail.com wrote:
> On Monday, April 5, 2004 3:01:17 AM UTC-5, (unknown) wrote:
>> 1) Non-rectangular shaped windows
>> 2) No decoration by window managers
>> 3) Transparent windows
>
> Hi, Been trying to do the same stuff. This works wonderfully in Tool
> Command Language 'Tcl' for making an application transparent, Lets do
> like a 35:
>
> wm attributes . -alpha .35 -topmost 1

Completely turning off decoration is usually done by setting the [wm
overrideredirect] flag, though there may be other ways as well.
Non-rectangular windows requires applying a shape mask to the window;
IIRC, the code I've got at:

http://www.cs.man.ac.uk/~fellowsd/tcl/shapeidx.html

still works, but it's had no maintenance for a decade or so, so I don't
know how easy it is to build. (There's no core feature for doing this
because we — well, I — never settled on a good way to describe shapes.)
I should warn that this is not stub-enabled code; it shouldn't be hard
to change that, but I never got around to doing it. :-)

Donal.

tcltk-d

unread,
Oct 7, 2012, 8:02:02 PM10/7/12
to
> On 05/10/2012 15:48, freemnemory......... wrote:
> > On Monday, April 5, 2004 3:01:17 AM UTC-5, (unknown) wrote:
> >> 1) Non-rectangular shaped windows
> >> 2) No decoration by window managers
> >> 3) Transparent windows

Oh! Tcl/Tk(v8.4win-) can doit completely by core.

wm overrideredirect [toplevel .some] 1
wm geometry .some 800x600+40+20
wm attribute .some -transparentcolor #C1C2C3
canvas .some.c -wid 800 -hei 600 -bg #C1C2C3 \
-bd 0 -relief flat -highlightthickness 0
pack .some.c -padx 0 -pady 0 -ipadx 0 -ipady 0
.some.c create oval 20 20 780 580 -width 1 -fill #ff0000
frame .some.c.w
pack [label .some.c.w.t -text "Bonjour! Tcl" -fg #C1C2C3]
.some.c create window 40 40 -window .some.c.w

Thats all

DrS

unread,
Oct 7, 2012, 11:04:33 PM10/7/12
to
On 10/7/2012 8:02 PM, tcltk-d wrote:
> Oh! Tcl/Tk(v8.4win-) can doit completely by core.
>
> wm overrideredirect [toplevel .some] 1
> wm geometry .some 800x600+40+20
> wm attribute .some -transparentcolor #C1C2C3
> canvas .some.c -wid 800 -hei 600 -bg #C1C2C3 \
> -bd 0 -relief flat -highlightthickness 0
> pack .some.c -padx 0 -pady 0 -ipadx 0 -ipady 0
> .some.c create oval 20 20 780 580 -width 1 -fill #ff0000
> frame .some.c.w
> pack [label .some.c.w.t -text "Bonjour! Tcl" -fg #C1C2C3]
> .some.c create window 40 40 -window .some.c.w
>
> Thats all


Nice and interesting. I copy-pasted your example and it works but how
do you move it around?


DrS


Christian Gollwitzer

unread,
Oct 8, 2012, 12:38:53 AM10/8/12
to
Am 08.10.12 05:04, schrieb DrS:
You have to do it yourself - i.e., create a handle, bind the usual drag
bindings to it - <B1-Motion> and such - and use wm geometry.

Christian

tcltk-d

unread,
Oct 8, 2012, 3:53:48 AM10/8/12
to
>
> Nice and interesting. I copy-pasted your example and it works but how
>
> do you move it around?
>

You said "2) No .... window managers".

Please command "wm geometry .some +123+456" via wish console.

Drag-toplevel GUI is another Tk Topic.

DrS

unread,
Oct 8, 2012, 3:26:45 PM10/8/12
to
On 10/8/2012 3:53 AM, tcltk-d wrote:
>
> You said "2) No .... window managers".
>
> Please command "wm geometry .some +123+456" via wish console.
>
> Drag-toplevel GUI is another Tk Topic.


No, I didn't say that. I saw a piece of code, tried it and had a
question. It was interesting and I could see where it can be a useful
trick.

DrS


tcltk-d

unread,
Oct 8, 2012, 7:44:27 PM10/8/12
to
Okey,do you know?
http://wiki.tcl.tk/9406

It is the best and super knowledgebase about TclTk.
On that site,manymany useful FAQs are recorded.

Uwe Klein

unread,
Oct 8, 2012, 4:52:51 PM10/8/12
to
tcltk-d wrote:
> wm attribute .some -transparentcolor #C1C2C3
> canvas .some.c -wid 800 -hei 600 -bg #C1C2C3 \

Which wm honors this construct?

a geriatric fvwm2 doesn't
a rather recent kdewm ( or whatever the name of the kde wm ) doesn't either.

uwe

Christian Gollwitzer

unread,
Oct 9, 2012, 4:17:15 AM10/9/12
to
Am 08.10.12 22:52, schrieb Uwe Klein:
On Aqua, it is also not working. Maybe only on Windows?

Christian

Colin Macleod

unread,
Oct 10, 2012, 3:30:50 AM10/10/12
to
On Tuesday, October 9, 2012 9:17:12 AM UTC+1, Christian Gollwitzer wrote:
> Am 08.10.12 22:52, schrieb Uwe Klein: > tcltk-d wrote: >> wm attribute .some -transparentcolor #C1C2C3 >> canvas .some.c -wid 800 -hei 600 -bg #C1C2C3 \ > > Which wm honors this construct? > > a geriatric fvwm2 doesn't > a rather recent kdewm ( or whatever the name of the kde wm ) doesn't > either. > On Aqua, it is also not working. Maybe only on Windows? Christian

Yes, it's Windows-only I'm afraid.

Uwe Klein

unread,
Oct 10, 2012, 3:54:29 AM10/10/12
to
<schnief>

uwe
0 new messages