Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"You are WRONG, you ol' brass-breasted fascist poop!" -- Bloom County


devel / comp.lang.tcl / Can I anchor a canvas element to the visible screen?

SubjectAuthor
* Can I anchor a canvas element to the visible screen?Luc
`* Can I anchor a canvas element to the visible screen?Ralf Fassel
 `* Can I anchor a canvas element to the visible screen?Luc
  `* Can I anchor a canvas element to the visible screen?Adrien Peulvast
   `- Can I anchor a canvas element to the visible screen?Ralf Fassel

1
Can I anchor a canvas element to the visible screen?

<20221115094028.63873f82@lud1.home>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!5fNieJ10Veff9nzZBR7qpg.user.46.165.242.75.POSTED!not-for-mail
From: no...@no.no (Luc)
Newsgroups: comp.lang.tcl
Subject: Can I anchor a canvas element to the visible screen?
Date: Tue, 15 Nov 2022 09:40:28 -0300
Organization: Aioe.org NNTP Server
Message-ID: <20221115094028.63873f82@lud1.home>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="32255"; posting-host="5fNieJ10Veff9nzZBR7qpg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Newsreader: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu)
X-Notice: Filtered by postfilter v. 0.9.2
 by: Luc - Tue, 15 Nov 2022 12:40 UTC

I have a canvas with a chart, a bar chart, and a grid background. Or maybe
that is more accurately described as a canvas with a grid and a bar chart
on top of it. It seems to me that whatever is drawn last becomes "on top"
of everything else.

And there is a "floating" canvas label that displays some data in a much more
evident way.

I have managed to make that chart "scrollable" left and right. I use the arrow
keys for that. But when I scrolled, the floating label would be pushed off the
right edge of the screen. I fixed that:

proc scrollchart {leftright} {
lassign [$::chart xview] x1 x2
if {$leftright == "left"} {
$::chart xview moveto [expr $x1 - 0.0005]
set ::toplabel_x [expr $::toplabel_x - 10]
}
if {$leftright == "right"} {
$::chart xview moveto [expr $x1 + 0.0005]
set ::toplabel_x [expr $::toplabel_x + 10]
}

That works very well. The label flickers a little, but it stays put.

But there is also this:

bind $::chart <B1-Motion> {%W scan dragto %x %y 1}

That works to the extent that I can indeed drag the chart left and right
with the mouse pointer, but then the floating label gets dragged too, which
I obviously don't want.

Maybe there is some code I could use to compensate for the movement like I did
in the scrollchart proc, but then I think, everything would be so much easier
if I could anchor some elements to some edge or corner of the visible screen
rather than to the canvas' hard coordinates.

I am struggling with that concept. Can someone please shed some light?

--
Luc
>>

Re: Can I anchor a canvas element to the visible screen?

<ygav8ngjkkp.fsf@akutech.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ralf...@gmx.de (Ralf Fassel)
Newsgroups: comp.lang.tcl
Subject: Re: Can I anchor a canvas element to the visible screen?
Date: Tue, 15 Nov 2022 16:36:54 +0100
Lines: 26
Message-ID: <ygav8ngjkkp.fsf@akutech.de>
References: <20221115094028.63873f82@lud1.home>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: individual.net DUSdI1r6DydGHP+oNYYAUQc9zy9OTu2qtFLW2vMkSLkfTwIek=
Cancel-Lock: sha1:msSyRXRFRj+KPaJlQvDN5xVs3UU= sha1:3757aX9ZfByJ//FzDWdhomIBNYE=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
 by: Ralf Fassel - Tue, 15 Nov 2022 15:36 UTC

* Luc <no@no.no>
| I have a canvas with a chart, a bar chart, and a grid background. Or maybe
| that is more accurately described as a canvas with a grid and a bar chart
| on top of it. It seems to me that whatever is drawn last becomes "on top"
| of everything else.
>
| And there is a "floating" canvas label that displays some data in a
| much more evident way.
>
| I have managed to make that chart "scrollable" left and right. I use the arrow
| keys for that. But when I scrolled, the floating label would be pushed off the
| right edge of the screen.
--<snip-snip>--
| That works to the extent that I can indeed drag the chart left and right
| with the mouse pointer, but then the floating label gets dragged too, which
| I obviously don't want.

Rather than trying to compensate for the canvas scrolling, place the
'floating' label in a separate canvas and [place] that one in the
original canvas?

canvas .c1 ; # the scrolled canvas
canvas .c1.c2 ; # the one with the floating label
place .c1.c2 -relx 0 -rely 0 ; # always top left in .c1

R'

Re: Can I anchor a canvas element to the visible screen?

<20221115135250.779ebb08@lud1.home>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!5fNieJ10Veff9nzZBR7qpg.user.46.165.242.75.POSTED!not-for-mail
From: no...@no.no (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: Can I anchor a canvas element to the visible screen?
Date: Tue, 15 Nov 2022 13:52:50 -0300
Organization: Aioe.org NNTP Server
Message-ID: <20221115135250.779ebb08@lud1.home>
References: <20221115094028.63873f82@lud1.home>
<ygav8ngjkkp.fsf@akutech.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="24030"; posting-host="5fNieJ10Veff9nzZBR7qpg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Newsreader: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu)
X-Notice: Filtered by postfilter v. 0.9.2
 by: Luc - Tue, 15 Nov 2022 16:52 UTC

On Tue, 15 Nov 2022 16:36:54 +0100, Ralf Fassel wrote:

> Rather than trying to compensate for the canvas scrolling, place the
> 'floating' label in a separate canvas and [place] that one in the
> original canvas?
>
> canvas .c1 ; # the scrolled canvas
> canvas .c1.c2 ; # the one with the floating label
> place .c1.c2 -relx 0 -rely 0 ; # always top left in .c1
>
> R'

Thanks.

That works in terms of positioning, but then the floating canvas eclipses
the background grid. Sadly, there is no transparent canvas in Tk.

--
Luc
>>

Re: Can I anchor a canvas element to the visible screen?

<tl1vus$1319$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!bJRC8AMvZZCtjVXtr28shg.user.46.165.242.75.POSTED!not-for-mail
From: adrien.p...@hotmail.com (Adrien Peulvast)
Newsgroups: comp.lang.tcl
Subject: Re: Can I anchor a canvas element to the visible screen?
Date: Wed, 16 Nov 2022 14:28:43 +0800
Organization: Aioe.org NNTP Server
Message-ID: <tl1vus$1319$1@gioia.aioe.org>
References: <20221115094028.63873f82@lud1.home> <ygav8ngjkkp.fsf@akutech.de>
<20221115135250.779ebb08@lud1.home>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="35881"; posting-host="bJRC8AMvZZCtjVXtr28shg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
X-Antivirus-Status: Clean
X-Antivirus: Avast (VPS 221116-0, 16/11/2022), Outbound message
Content-Language: fr
X-Notice: Filtered by postfilter v. 0.9.2
 by: Adrien Peulvast - Wed, 16 Nov 2022 06:28 UTC

Le 16/11/2022 à 00:52, Luc a écrit :
> On Tue, 15 Nov 2022 16:36:54 +0100, Ralf Fassel wrote:
>
>> Rather than trying to compensate for the canvas scrolling, place the
>> 'floating' label in a separate canvas and [place] that one in the
>> original canvas?
>>
>> canvas .c1 ; # the scrolled canvas
>> canvas .c1.c2 ; # the one with the floating label
>> place .c1.c2 -relx 0 -rely 0 ; # always top left in .c1
>>
>> R'
>
>
> Thanks.
>
> That works in terms of positioning, but then the floating canvas eclipses
> the background grid. Sadly, there is no transparent canvas in Tk.
>
>

Hello, but there is "transparent" toplevel in which you could pack the
canvas and then use the transparent color in canvas background. Then
place the transparent toplevel where you wish to.

--
Cet e-mail a été vérifié par le logiciel antivirus d'Avast.
www.avast.com

Re: Can I anchor a canvas element to the visible screen?

<ygar0y3jg84.fsf@akutech.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!lilly.ping.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ralf...@gmx.de (Ralf Fassel)
Newsgroups: comp.lang.tcl
Subject: Re: Can I anchor a canvas element to the visible screen?
Date: Wed, 16 Nov 2022 12:23:07 +0100
Lines: 14
Message-ID: <ygar0y3jg84.fsf@akutech.de>
References: <20221115094028.63873f82@lud1.home> <ygav8ngjkkp.fsf@akutech.de>
<20221115135250.779ebb08@lud1.home> <tl1vus$1319$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net bz8f/4Mm+qPFl+TxEX+GhQdwv8qwvureJE8V6/8/fhes97+X4=
Cancel-Lock: sha1:BMgnoerjzl7uqtHCcVxSVAnvdzc= sha1:r9VKEump8cNj0ECP3y6DqN9SCWg=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
 by: Ralf Fassel - Wed, 16 Nov 2022 11:23 UTC

* Adrien Peulvast <adrien.peulvast@hotmail.com>
| Le 16/11/2022 à 00:52, Luc a écrit :
| > Thanks.
| > That works in terms of positioning, but then the floating canvas
| > eclipses the background grid. Sadly, there is no transparent canvas in Tk.
| >
>
| Hello, but there is "transparent" toplevel in which you could pack the
| canvas and then use the transparent color in canvas background.

What is the "transparent color" for the canvas? Could you show the
-configure line?

R'


devel / comp.lang.tcl / Can I anchor a canvas element to the visible screen?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor