Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Counting in binary is just like counting in decimal -- if you are all thumbs. -- Glaser and Way


devel / comp.lang.tcl / Jumpy mouse

SubjectAuthor
* Jumpy mousesaitology9
+* Re: Jumpy mouseLuc
|`- Re: Jumpy mousesaito
`* Re: Jumpy mouseRich
 `* Re: Jumpy mousesaito
  `- Re: Jumpy mouseabu

1
Jumpy mouse

<usvqna$1rue2$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: saitolo...@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Jumpy mouse
Date: Thu, 14 Mar 2024 17:37:45 -0400
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <usvqna$1rue2$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 14 Mar 2024 21:37:46 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4083d73dceb93e6817bf2dba3d9d354b";
logging-data="1964482"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Uxbz3VNNOn6eyA1el9t6c"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:41bDgsBT4Wo0m/1rGTNY5DHKnO8=
Content-Language: en-US
 by: saitology9 - Thu, 14 Mar 2024 21:37 UTC

Can anyone spot what is wrong here?
You can click and drag he label to move the window.
However, the mouse jumps to the top left corner, instead of maintaining
its position relative to the window.

### code follows ###########
package require Tk

label .l -text "Move me to move the window" -width 40 -height 10
pack .l -fill both -expand 1

bind .l <B1-Motion> [list moveme %W %x %y]

proc moveme {win x y} {
set top [winfo toplevel $win]
lassign [split [winfo geometry $top] "+"] dims x1 y1

set newX [expr {$x1 + $x}]
set newY [expr {$y1 + $y}]

wm geometry $top "${dims}+${newX}+${newY}"
} ### end of code ############

Re: Jumpy mouse

<20240314204205.011e53c5@lud1.home>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc...@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: Jumpy mouse
Date: Thu, 14 Mar 2024 20:42:05 -0300
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <20240314204205.011e53c5@lud1.home>
References: <usvqna$1rue2$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="b26639b2bbb687074bc4cdd8e4bf7733";
logging-data="2002962"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+S6WPOOaf2G++XxyLVp5ieH8Nu8hEetDo="
Cancel-Lock: sha1:KkXP0i8aEwXmrKCjBSR/JFYvJig=
 by: Luc - Thu, 14 Mar 2024 23:42 UTC

On Thu, 14 Mar 2024 17:37:45 -0400, saitology9 wrote:

### code follows ###########
package require Tk

label .l -text "Move me to move the window" -width 40 -height 10
pack .l -fill both -expand 1

bind .l <1> {
set coords "%x %y"
lassign $coords ::labelx ::labely
} bind .l <B1-Motion> {
moveme %W %x %y
}

proc moveme {win x y} {
set top [winfo toplevel $win]
lassign [split [winfo geometry $top] "+"] dims x1 y1

set newX [expr {$x1 + $x}]
set newY [expr {$y1 + $y}]
set newX [expr {$newX - $::labelx}]
set newY [expr {$newY - $::labely}]

wm geometry $top "${dims}+${newX}+${newY}"
}

### end of code ############

--
Luc
>>

Re: Jumpy mouse

<ut02td$1te9h$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: saitolo...@gmail.com (saito)
Newsgroups: comp.lang.tcl
Subject: Re: Jumpy mouse
Date: Thu, 14 Mar 2024 19:57:32 -0400
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <ut02td$1te9h$1@dont-email.me>
References: <usvqna$1rue2$1@dont-email.me> <20240314204205.011e53c5@lud1.home>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 14 Mar 2024 23:57:34 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e180e9fc5a4195c99a8fc8900725c60d";
logging-data="2013489"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+8NAbHd///tHWEZu5q6SeY"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:aj91SXeoezs7xSCYXNzTQ64iDfE=
Content-Language: en-US
In-Reply-To: <20240314204205.011e53c5@lud1.home>
 by: saito - Thu, 14 Mar 2024 23:57 UTC

On 3/14/2024 7:42 PM, Luc wrote:
> On Thu, 14 Mar 2024 17:37:45 -0400, saitology9 wrote:
>
>
Works great; thank you!

Re: Jumpy mouse

<ut09hs$1ul5d$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ric...@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: Jumpy mouse
Date: Fri, 15 Mar 2024 01:50:52 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <ut09hs$1ul5d$1@dont-email.me>
References: <usvqna$1rue2$1@dont-email.me>
Injection-Date: Fri, 15 Mar 2024 01:50:52 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="eb7533b16a2adc251fe398b9db015395";
logging-data="2053293"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19mzAWKM0+BWtmDqsQTEqw5"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
Cancel-Lock: sha1:lHx+r54oRKM+Zsu19OUSC3jb4kM=
 by: Rich - Fri, 15 Mar 2024 01:50 UTC

saitology9 <saitology9@gmail.com> wrote:
> Can anyone spot what is wrong here?
> You can click and drag he label to move the window.
> However, the mouse jumps to the top left corner, instead of
> maintaining its position relative to the window.

To be padantic, it is not the mouse that jumps, it is the window that
jumps so that the window's top left is just below the mouse hotspot.
The mouse remains at exactly the same spot on screen as where it
started.

Luc supplied updated code that worked, but did not explain why the code
worked. You were not accounting for the position of the mouse (offset
of mouse pointer) from top left corner when setting up your geometry
string calculations. The geometry string positions the top left corner
of the window, so you have to include the mouse offset that was present
when the button was first depressed to keep the window from jumping to
be aligned top-left with the mouse.

Re: Jumpy mouse

<ut1ure$2cg5g$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: saitolo...@gmail.com (saito)
Newsgroups: comp.lang.tcl
Subject: Re: Jumpy mouse
Date: Fri, 15 Mar 2024 13:00:28 -0400
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <ut1ure$2cg5g$1@dont-email.me>
References: <usvqna$1rue2$1@dont-email.me> <ut09hs$1ul5d$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 15 Mar 2024 17:00:30 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4d9dfa26d4bbf13b3e9c6ecbd33fc22e";
logging-data="2506928"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19LsiVq8atV8AYo5hSLp0qu"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:ytKbpTMzsOuvQsc3aN2iqspepSQ=
In-Reply-To: <ut09hs$1ul5d$1@dont-email.me>
Content-Language: en-US
 by: saito - Fri, 15 Mar 2024 17:00 UTC

On 3/14/2024 9:50 PM, Rich wrote:
> saitology9 <saitology9@gmail.com> wrote:
>> Can anyone spot what is wrong here?
>> You can click and drag he label to move the window.
>> However, the mouse jumps to the top left corner, instead of
>> maintaining its position relative to the window.
>
> To be padantic, it is not the mouse that jumps, it is the window that

Not to be pedantic, I won't point out the irony above :-)

Thank you for the nice description.

Re: Jumpy mouse

<3fdc0778b0616dfa1d2957116eea8817@www.rocksolidbbs.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!.POSTED!not-for-mail
From: aldo.w.b...@gmail.com (abu)
Newsgroups: comp.lang.tcl
Subject: Re: Jumpy mouse
Date: Mon, 18 Mar 2024 00:34:02 +0000
Organization: RetroBBS
Message-ID: <3fdc0778b0616dfa1d2957116eea8817@www.rocksolidbbs.com>
References: <usvqna$1rue2$1@dont-email.me> <ut09hs$1ul5d$1@dont-email.me> <ut1ure$2cg5g$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="2351713"; mail-complaints-to="usenet@i2pn2.org";
posting-account="qk6pvs/sIyKYNRNFdjVS+ghlZZkCUq7cWs+7p7kaLpU";
User-Agent: Rocksolid Light
X-Rslight-Site: $2y$10$jsJfOhoM64JN/g.LV5ULUeCSsDmscz93k9b70LZQ4L1bbFMCzXQtK
X-Rslight-Posting-User: 03eebb131362ce2f1c43033a15c71f269c1889b8
X-Spam-Checker-Version: SpamAssassin 4.0.0
 by: abu - Mon, 18 Mar 2024 00:34 UTC

## It can be simplified

package require Tk

label .l -text "Move me to move the window" -width 40 -height 10
pack .l -fill both -expand 1

bind .l <1> {
set top [winfo toplevel %W]
set ::displacementX [expr {%X-[winfo rootx $top]}]
set ::displacementY [expr {%Y-[winfo rooty $top]}]
} bind .l <B1-Motion> {
moveme [winfo toplevel %W] [expr {%X-$::displacementX}] [expr {%Y-$::displacementY}]
}

proc moveme {top X Y} {
wm geometry $top +$X+$Y
}

### end of code ############

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor