Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The bug stops here.


devel / comp.lang.tcl / Re: Screen coordinates of cursor position in text and entry widgets

SubjectAuthor
* Screen coordinates of cursor position in text and entry widgetsTorsten
`* Screen coordinates of cursor position in text and entry widgetsArjen Markus
 `* Screen coordinates of cursor position in text and entry widgetsAndreas Leitgeb
  `* Screen coordinates of cursor position in text and entry widgetsTorsten
   `- Screen coordinates of cursor position in text and entry widgetssaitology9

1
Screen coordinates of cursor position in text and entry widgets

<tr6fij$2sngo$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10622&group=comp.lang.tcl#10622

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Tors...@example.com (Torsten)
Newsgroups: comp.lang.tcl
Subject: Screen coordinates of cursor position in text and entry widgets
Date: Sun, 29 Jan 2023 19:57:23 +0100
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <tr6fij$2sngo$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 29 Jan 2023 18:57:23 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="faa3f71bd95e0e1c18a51c9ab8ce2b57";
logging-data="3038744"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+N7NNjCV41ay2LAaGVYVBm"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.7.0
Cancel-Lock: sha1:kqco0c0tq3AJDeO3PK47QQOFtTo=
Content-Language: en-GB
 by: Torsten - Sun, 29 Jan 2023 18:57 UTC

I have a context menu for text and entry widgets. When I click the right mouse button, I open it a
the mouse cursor position.

When I press the context menu key, i.e. keysym 'App' for Windows and 'Menu' for Linux and macOS, I
want it to open at the cursor position of the text or entry field.

How do I get the screen coordinates of the cursor position in that case?

Re: Screen coordinates of cursor position in text and entry widgets

<3a771c24-a133-449f-939c-4a3a45060e89n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10625&group=comp.lang.tcl#10625

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:6214:1d0e:b0:537:cb41:1982 with SMTP id e14-20020a0562141d0e00b00537cb411982mr727245qvd.44.1675025145814;
Sun, 29 Jan 2023 12:45:45 -0800 (PST)
X-Received: by 2002:a81:4d04:0:b0:510:3963:db9d with SMTP id
a4-20020a814d04000000b005103963db9dmr381338ywb.307.1675025145612; Sun, 29 Jan
2023 12:45:45 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Sun, 29 Jan 2023 12:45:45 -0800 (PST)
In-Reply-To: <tr6fij$2sngo$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=62.194.189.128; posting-account=A91wAAoAAADgBUxBX6QqsrSD26GLhVp8
NNTP-Posting-Host: 62.194.189.128
References: <tr6fij$2sngo$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3a771c24-a133-449f-939c-4a3a45060e89n@googlegroups.com>
Subject: Re: Screen coordinates of cursor position in text and entry widgets
From: arjen.ma...@gmail.com (Arjen Markus)
Injection-Date: Sun, 29 Jan 2023 20:45:45 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1797
 by: Arjen Markus - Sun, 29 Jan 2023 20:45 UTC

On Sunday, January 29, 2023 at 7:57:27 PM UTC+1, Torsten wrote:
> I have a context menu for text and entry widgets. When I click the right mouse button, I open it a
> the mouse cursor position.
>
> When I press the context menu key, i.e. keysym 'App' for Windows and 'Menu' for Linux and macOS, I
> want it to open at the cursor position of the text or entry field.
>
> How do I get the screen coordinates of the cursor position in that case?

You probably want [winfo pointerxy], as that returns the x/y coordinates of the pointer wrt the screen that holds the window. I do not think I have ever used it myself, so I simply rely on the man page :).

Regards,

Arjen

Re: Screen coordinates of cursor position in text and entry widgets

<slrnttjcj1.pa7s.avl@logic.at>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10642&group=comp.lang.tcl#10642

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: avl...@logic.at (Andreas Leitgeb)
Newsgroups: comp.lang.tcl
Subject: Re: Screen coordinates of cursor position in text and entry widgets
Date: Wed, 1 Feb 2023 00:29:21 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <slrnttjcj1.pa7s.avl@logic.at>
References: <tr6fij$2sngo$1@dont-email.me>
<3a771c24-a133-449f-939c-4a3a45060e89n@googlegroups.com>
Reply-To: avl@logic.at
Injection-Date: Wed, 1 Feb 2023 00:29:21 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="ce841eb8ff8643107f1a0f63faeeb8de";
logging-data="34098"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+I28v/vJ6+Z4EDKEGELZD+"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:rvlnVCiFcQKSi5RfMUt6acJ5nJA=
 by: Andreas Leitgeb - Wed, 1 Feb 2023 00:29 UTC

Arjen Markus <arjen.markus895@gmail.com> wrote:
> On Sunday, January 29, 2023 at 7:57:27 PM UTC+1, Torsten wrote:
>> I have a context menu for text and entry widgets. When I click the right mouse button, I open it a
>> the mouse cursor position.
>> When I press the context menu key, i.e. keysym 'App' for Windows and 'Menu' for Linux and macOS, I
>> want it to open at the cursor position of the text or entry field.
>> How do I get the screen coordinates of the cursor position in that case?
> You probably want [winfo pointerxy], as that returns the x/y coordinates
> of the pointer wrt the screen that holds the window. I do not think I have
> ever used it myself, so I simply rely on the man page :).

My understanding of the question was, that he wanted the coords of the
widget's "insertion"-cursor - as in: "that blinking thingie"

For an entry widget .e the following might get you further:
lassign [.e bbox insert] px py dx dy
# do some arithmetics to determine the hotspot of that bbox, e.g.:
set py [expr {$py+$dy/2}]
# add the widget's global coords:
incr px [winfo rootx .e]; incr py [winfo rooty .e]

for text-widgets it might be pretty similar...

Re: Screen coordinates of cursor position in text and entry widgets

<trh59a$11epu$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10654&group=comp.lang.tcl#10654

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Tors...@example.com (Torsten)
Newsgroups: comp.lang.tcl
Subject: Re: Screen coordinates of cursor position in text and entry widgets
Date: Thu, 2 Feb 2023 21:09:13 +0100
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <trh59a$11epu$1@dont-email.me>
References: <tr6fij$2sngo$1@dont-email.me>
<3a771c24-a133-449f-939c-4a3a45060e89n@googlegroups.com>
<slrnttjcj1.pa7s.avl@logic.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 2 Feb 2023 20:09:14 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="a9c47da2cd8fb6fa171e61e27ab8fa6b";
logging-data="1096510"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/sSvrooKyxldpYa4JZiSFc"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.7.0
Cancel-Lock: sha1:42fg8FdMSyjgCIxpTpwsBMREtJ0=
Content-Language: en-GB
In-Reply-To: <slrnttjcj1.pa7s.avl@logic.at>
 by: Torsten - Thu, 2 Feb 2023 20:09 UTC

-------- Original-Nachricht --------
> Arjen Markus <arjen.markus895@gmail.com> wrote:

> For an entry widget .e the following might get you further:
> lassign [.e bbox insert] px py dx dy
> # do some arithmetics to determine the hotspot of that bbox, e.g.:
> set py [expr {$py+$dy/2}]
> # add the widget's global coords:
> incr px [winfo rootx .e]; incr py [winfo rooty .e]
>
> for text-widgets it might be pretty similar...
>
That is exactly what I was looking for: The index named "insert".
I just missed it while reading the man page (and then did not check the entry page).
Thank you Arjen!

Re: Screen coordinates of cursor position in text and entry widgets

<trhbhs$12fcd$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10655&group=comp.lang.tcl#10655

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: saitolo...@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Re: Screen coordinates of cursor position in text and entry widgets
Date: Thu, 2 Feb 2023 16:56:10 -0500
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <trhbhs$12fcd$1@dont-email.me>
References: <tr6fij$2sngo$1@dont-email.me>
<3a771c24-a133-449f-939c-4a3a45060e89n@googlegroups.com>
<slrnttjcj1.pa7s.avl@logic.at> <trh59a$11epu$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 2 Feb 2023 21:56:12 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="c94ba7d233c2a3266e7b59cc4e0639d7";
logging-data="1129869"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19lQZqwrL/RYpVz3mUYANoj"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.3.2
Cancel-Lock: sha1:ptmLokhxSKGKxBki4GFIoboBg6A=
Content-Language: en-US
In-Reply-To: <trh59a$11epu$1@dont-email.me>
 by: saitology9 - Thu, 2 Feb 2023 21:56 UTC

On 2/2/2023 3:09 PM, Torsten wrote:
> -------- Original-Nachricht --------
>> Arjen Markus <arjen.markus895@gmail.com> wrote:
>
>> For an entry widget .e the following might get you further:
>>     lassign [.e bbox insert] px py dx dy
>>     # do some arithmetics to determine the hotspot of that bbox, e.g.:
>>     set py [expr {$py+$dy/2}]
>>     # add the widget's global coords:
>>     incr px [winfo rootx .e]; incr py [winfo rooty .e]
>>
>> for text-widgets it might be pretty similar...
>>
> That is exactly what I was looking for: The index named "insert".
> I just missed it while reading the man page (and then did not check the
> entry page).
> Thank you Arjen!
>

While they are both very helpful individuals, I think you meant Andreas
Leitgeb above since you quoted from his message :-)

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor