[Idle-dev] Setting the X resource options for IDLE windows

Guido van Rossum guido@python.org
Mon, 06 Mar 2000 10:30:08 -0500


Randall Hopper has asked me to make sure that IDLE's windows have
reasonable names as seen by the X server and other X clients
(especially window managers), so that options can be set reasonably.

I've run into a few snags.

It's easy enough to set the name for the root Tk() window: use

  root = Tk(className="Idle")

This will set the X11 proprerty WM_CLASS to ("idle", "Idle") when seen
through xprop, and WM_NAME to "idle".

But, the root is immediately withdrawn; all EditorWindows use
Toplevel().  To set the WM_CLASS property on these, I can use

  win = Toplevel(class_="Idle")

This sets WM_CLASS to "123456", "Idle".  In other words, the class is
indeed Idle but the instance is the randomly chosen widget name.  If I
use

  win = Toplevel(class_="Idle", name="idle")

I can only create one Toplevel, because "name" is now used as the Tk
widget name (".idle") and you can't have two widgets with the same
name.

I notice that the WM_NAME property is "idle" (same as the instance
part of WM_CLASS).

I have no idea which property window managers use to configure icons
etc. for windows (I'm not a very sophisticated X user and I'd like to
keep it that way :-).

Suggestions?

Randall also suggested that (as a fallback) the title and icon names
could be set to "idle: ...".  I have no problem with this, but I'm not
sure if it's enough...

Feedback?

--Guido van Rossum (home page: http://www.python.org/~guido/)