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

[winfo id] does not return as [xwininfo] does

55 views
Skip to first unread message

tombert

unread,
May 4, 2019, 7:36:55 PM5/4/19
to
Why is that different:

In a wish type:
% toplevel .test
% winfo id .test
0x3a001ba

In a terminal type [xwininfo] and click on the toplevel:
xwininfo: Window id: 0x3a001bb "test"

Why do these methods return different IDs!?

thx

tombert

unread,
May 4, 2019, 7:45:49 PM5/4/19
to
Note that it's not always one off, but in my app the offset is 20:

xwininfo returns 0x2e007b1
winfo id returns 0x2e0079d

Donal K. Fellows

unread,
May 5, 2019, 6:34:10 AM5/5/19
to
On 05/05/2019 00:36, tombert wrote:
> Why do these methods return different IDs!?

Because there are extra layers of X window involved. Tk adds an extra
one to enable it to put a menu bar in for the -menu option, and the
window manager often adds multiple windows of its own to do its decorations.

Donal.
--
Donal Fellows — Tcl user, Tcl maintainer, TIP editor.

tombert

unread,
May 5, 2019, 8:46:41 AM5/5/19
to
So means that I have to find all it's parents/children of a specific ID?
Would you be so kind providing me a tip what you would do?

I need this for xwininfo -id <id> to query the iconified state since this is the other thing that is not working ...

two...@gmail.com

unread,
May 5, 2019, 9:23:53 PM5/5/19
to
On Sunday, May 5, 2019 at 5:46:41 AM UTC-7, tombert wrote:

>
> I need this for xwininfo -id <id> to query the iconified state since this is the other thing that is not working ...

Have you considered using -name instead of -id,

xwininfo -name <title>

you can set the title in tk with

wm title . hello

and then, after minimizing the window,

$ xwininfo -name hello -wm

xwininfo: Window id: 0x240000a "hello"

Window manager hints:
Client accepts input or input focus: Yes
Initial state is Normal State
Displayed on desktop 0
Window state:
Hidden
Process id: (unknown)
Frame extents: 0, 0, 37, 0


This is from my pop os variant of ubuntu, with gnome.

tombert

unread,
May 6, 2019, 1:47:12 AM5/6/19
to
Yes I have considered this, but since the name is not necessarily unique it's not a way to go for me.

thx
0 new messages