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

Window Names

41 views
Skip to first unread message

Roderick

unread,
Oct 9, 2018, 4:33:19 PM10/9/18
to

Hallo!

It is completely new to me that windows names cannot begin with
upper-case letters.

Are there more restrictions?

Thanks
Rodrigo

Gerald Lester

unread,
Oct 9, 2018, 5:41:30 PM10/9/18
to
On 10/09/2018 03:26 PM, Roderick wrote:
>
> Hallo!
>
> It is completely new to me that windows names cannot begin with
> upper-case letters.
>
> Are there more restrictions?

They are a tree hierarchy starting with the root window being ".".

A "." separates parents and children.

The parent must exist for the child to exist and must be created before
the child.

The can't begin with an upper case is a X windows legacy.

--
+----------------------------------------------------------------------+
| Gerald W. Lester, President, KNG Consulting LLC |
| Email: Gerald...@kng-consulting.net |
+----------------------------------------------------------------------+

skuh...@web.de

unread,
Oct 10, 2018, 1:15:55 AM10/10/18
to
Am Dienstag, 9. Oktober 2018 23:41:30 UTC+2 schrieb Gerald Lester:
> On 10/09/2018 03:26 PM, Roderick wrote:
> >
> > Hallo!
> >
> > It is completely new to me that windows names cannot begin with
> > upper-case letters.
> >
> > Are there more restrictions?

Only the path-name of a Window can not start with upper-case letters and some other, when you create them as Tk-hierarchy. But you can of course you can set the Window-Name as seen by the user (the name written into the Frame-Top, where the user interacts with) to anything you want with [wm title window ?string?].

Roderick

unread,
Oct 10, 2018, 3:53:00 AM10/10/18
to

Thanks for both answers!

> The can't begin with an upper case is a X windows legacy.

I am taking the windows names from a database whose content should
be as general as possible. The names could also contain non
alphabetical, but human readable characters, including "." and
"$" that may be a problem.

Perhaps the best is to encode these names before making it widget
names. The real name of the widget is at this moment irrelevant for me.
Perhaps the following as encoding:

proc w {name} {return "_[binary encode base64 $name]"}

Do someone have a better proposal for an injective function?

I see the restriction "not upper case" is quite arbitrary:

% entry .45
.45
% entry .+
.+
% entry ./
./
% entry ._
._
% entry .ä

% entry .Ä

% entry .A
window name starts with an upper-case letter: "A"

Thanks
Rodrigo

skuh...@web.de

unread,
Oct 10, 2018, 3:58:35 AM10/10/18
to
How about using generic names with a counter and then save the mapping between your DB-item and the widget-name in a dict, like

set entryName [entry .e[incr entryCount]]
set entryDict $entryName $dbItem

Roderick

unread,
Oct 10, 2018, 5:05:11 AM10/10/18
to


On Wed, 10 Oct 2018, skuh...@web.de wrote:

> How about using generic names with a counter [...]

Yes, numbering is the simplest injective function! :)

Thanks
Rodrigo

0 new messages