Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

21 May, 2024: Computers section is temporarily disabled for maintenance. It will take several days before it's back.


devel / comp.lang.tcl / Image in labels mess them all up

SubjectAuthor
* Image in labels mess them all upLuc
+* Re: Image in labels mess them all upD Groth
|+- Re: Image in labels mess them all upsaitology9
|`* Re: Image in labels mess them all upLuc
| `* Re: Image in labels mess them all upGerald Lester
|  `* Re: Image in labels mess them all upLuc
|   `* Re: Image in labels mess them all upAndreas Leitgeb
|    `- Re: Image in labels mess them all upLuc
`* Re: Image in labels mess them all upsaitology9
 `* Re: Image in labels mess them all upLuc
  `* Re: Image in labels mess them all upsaitology9
   +* Re: Image in labels mess them all upRich
   |`* Re: Image in labels mess them all upLuc
   | `* Re: Image in labels mess them all upRich
   |  `* Re: Image in labels mess them all upLuc
   |   +- Re: Image in labels mess them all upet99
   |   `- Re: Image in labels mess them all upRich
   `- Re: Image in labels mess them all upLuc

1
Image in labels mess them all up

<20230608204651.6ba8a233@lud1.home>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Image in labels mess them all up
Date: Thu, 8 Jun 2023 20:46:51 -0300
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <20230608204651.6ba8a233@lud1.home>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="f2ae2ecce74ae991c046ee2bbe578815";
logging-data="1751122"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+3jR8l2f5Zay3nGVj6TrqmZbNacUbR4X8="
Cancel-Lock: sha1:QHkZicaTKj1tDy3WKTZ/JPTkr+4=
 by: Luc - Thu, 8 Jun 2023 23:46 UTC

Would someone please like to take a look at this video and explain
to me what is going on here? I swear I don't have a clue.

https://0x0.st/HcTs.mp4

I'm not posting the entire code because the video illustrates
the problem very well and I believe the relevant part of the
code is all there.

Thanks in advance.

--
Luc
>>

Re: Image in labels mess them all up

<0758a5be-bb81-4e06-b63b-718332bfa87an@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:6214:1628:b0:628:4b4e:50ac with SMTP id e8-20020a056214162800b006284b4e50acmr136203qvw.13.1686294248600;
Fri, 09 Jun 2023 00:04:08 -0700 (PDT)
X-Received: by 2002:a05:6214:162e:b0:626:1a54:3de1 with SMTP id
e14-20020a056214162e00b006261a543de1mr172319qvw.0.1686294248320; Fri, 09 Jun
2023 00:04:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Fri, 9 Jun 2023 00:04:08 -0700 (PDT)
In-Reply-To: <20230608204651.6ba8a233@lud1.home>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:9e8:f9:db00:7af5:ae29:f65b:f115;
posting-account=l1SsogoAAADI9wGGep0j80-iEOPtae47
NNTP-Posting-Host: 2001:9e8:f9:db00:7af5:ae29:f65b:f115
References: <20230608204651.6ba8a233@lud1.home>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0758a5be-bb81-4e06-b63b-718332bfa87an@googlegroups.com>
Subject: Re: Image in labels mess them all up
From: tbgroth15@gmail.com (D Groth)
Injection-Date: Fri, 09 Jun 2023 07:04:08 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: D Groth - Fri, 9 Jun 2023 07:04 UTC

Luc schrieb am Freitag, 9. Juni 2023 um 01:46:56 UTC+2:
> Would someone please like to take a look at this video and explain
> to me what is going on here? I swear I don't have a clue.
>
>
> https://0x0.st/HcTs.mp4
>
>
> I'm not posting the entire code because the video illustrates
> the problem very well and I believe the relevant part of the
> code is all there.
>
> Thanks in advance.
>
> --
> Luc
> >>

Dear Luc,

please post short code examples to show what your problem is. Nobody will click usually on dubious image or video links. Having the code in the group as well will help future readers of the message where the video or the image link is already pointing to 404...

Best,
Detlef

Re: Image in labels mess them all up

<u5vq6t$1vj5q$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: saitology9@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Re: Image in labels mess them all up
Date: Fri, 9 Jun 2023 14:14:50 -0400
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <u5vq6t$1vj5q$1@dont-email.me>
References: <20230608204651.6ba8a233@lud1.home>
<0758a5be-bb81-4e06-b63b-718332bfa87an@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 9 Jun 2023 18:14:53 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5efd23748426946211091566d5ced208";
logging-data="2084026"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Tk+5vPkfjEIrIH/xVnJtu"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:UzizpfvwOS1KZtcCGdaEIwVUs0A=
In-Reply-To: <0758a5be-bb81-4e06-b63b-718332bfa87an@googlegroups.com>
Content-Language: en-US
 by: saitology9 - Fri, 9 Jun 2023 18:14 UTC

On 6/9/2023 3:04 AM, D Groth wrote:
> Dear Luc,
>
> please post short code examples to show what your problem is. Nobody will click usually on dubious image or video links. Having the code in the group as well will help future readers of the message where the video or the image link is already pointing to 404...
>

True. The video format has also inadvertently made it more difficult for
someone to offer assistance without resizing the video window, stopping
it, writing everything from scratch, etc.

Re: Image in labels mess them all up

<u5vr7s$1vj5q$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: saitology9@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Re: Image in labels mess them all up
Date: Fri, 9 Jun 2023 14:32:25 -0400
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <u5vr7s$1vj5q$2@dont-email.me>
References: <20230608204651.6ba8a233@lud1.home>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 9 Jun 2023 18:32:29 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5efd23748426946211091566d5ced208";
logging-data="2084026"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/vDOPo8tEW8voo/wIlrLd8"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:iQuQt18VjspaJdLLBz6v2eOVJ0g=
In-Reply-To: <20230608204651.6ba8a233@lud1.home>
Content-Language: en-US
 by: saitology9 - Fri, 9 Jun 2023 18:32 UTC

On 6/8/2023 7:46 PM, Luc wrote:
>
> I'm not posting the entire code because the video illustrates
> the problem very well and I believe the relevant part of the
> code is all there.
>
> Thanks in advance.
>

I think your problem is in the other column labels expanding to fill the
space from the name.

Not all of the labels in your script need to be "-fill x". As fas as I
can tell, only the first one, "name", needs to be that, and the rest
should have a fixed size. You may also want to make sure that you
configure "name" with "-expand 1" in addition to "-fill x".

Re: Image in labels mess them all up

<20230609180654.2bb8266e@lud1.home>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: Image in labels mess them all up
Date: Fri, 9 Jun 2023 18:06:54 -0300
Organization: A noiseless patient Spider
Lines: 76
Message-ID: <20230609180654.2bb8266e@lud1.home>
References: <20230608204651.6ba8a233@lud1.home>
<0758a5be-bb81-4e06-b63b-718332bfa87an@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="63e17c6222c18df31b3313c5fd7884e7";
logging-data="2125049"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+DKvum1y4UaCcCa6M+5O1/DE2A2Ytke6U="
Cancel-Lock: sha1:skLAbuFWQZTPECGEA70UrI3JARI=
 by: Luc - Fri, 9 Jun 2023 21:06 UTC

On Fri, 9 Jun 2023 00:04:08 -0700 (PDT), D Groth wrote:

> Dear Luc,
>
> please post short code examples to show what your problem is. Nobody
> will click usually on dubious image or video links. Having the code in
> the group as well will help future readers of the message where the
> video or the image link is already pointing to 404...
>
> Best,
> Detlef

Well, here is the code. But you don't have the SVG icon file.

package require Tk
load "/home/tcl/fm/libtksvg0.12.so"
set file "/home/tcl/fm/icons/svg/folder_open3.svg"
image create photo i1 -file $file -format {svg -scaletoheight 24}

bind . <Escape> {exit}
pack [frame .outerframe -bg #ffffff]
pack [frame .outerframe.line0 -padx 0 -pady 0 -relief raised -bd 0 -bg #ffffff]

set ::headings {
line0 Name heading_name
line0 Size heading_size
line0 Modified heading_date
line0 Permissions heading_perms
line0 Owner heading_owner
} foreach {line name col} $::headings {
set w [button .outerframe.$line.$col -text $name -anchor w -relief raised -font {Arial 14} -width 10 -bd 1 -anchor center -padx 0 -pady 0]
if {$col == "heading_name"} {.outerframe.$line.$col configure -width 50 -text "$name [subst -nocommands \\u25be]"}
pack $w -side left -fill x
} pack [frame .line1] [frame .line2] [frame .line3] [frame .line4]

set ::data {
line1 "File 1" name
line1 "32.1 Mb" size
line1 2023-05-05 date
line1 755 perms
line1 root:root owner

line2 "File 2" name
line2 "32.1 Mb" size
line2 2023-05-05 date
line2 755 perms
line2 root:root owner

line3 "File 3" name
line3 "32.1 Mb" size
line3 2023-05-05 date
line3 755 perms
line3 root:root owner

line4 "File 4" name
line4 "32.1 Mb" size
line4 2023-05-05 date
line4 755 perms
line4 root:root owner
} foreach {line name val} $::data {
set w [label .$line.$val -text $name -anchor w -relief flat -font {Arial 14} -width 10 -fg #000000 -bg #ffffff -bd 2 -anchor center]
if {$line == "line1"} {.$line.$val configure -bg #4A6984 -fg #ffffff}
if {$val == "name"} {.$line.$val configure -width 50 -anchor w}
pack $w -side left -fill x
}

--
Luc
>>

Re: Image in labels mess them all up

<20230609180753.410e291d@lud1.home>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: Image in labels mess them all up
Date: Fri, 9 Jun 2023 18:07:53 -0300
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <20230609180753.410e291d@lud1.home>
References: <20230608204651.6ba8a233@lud1.home>
<u5vr7s$1vj5q$2@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="63e17c6222c18df31b3313c5fd7884e7";
logging-data="2125049"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18RS4OR+qNgKrCn/9sY998RuGFYEhGvDa4="
Cancel-Lock: sha1:c/SgjdkxeRUtof55DPb/G9PXK0Q=
 by: Luc - Fri, 9 Jun 2023 21:07 UTC

On Fri, 9 Jun 2023 14:32:25 -0400, saitology9 wrote:

> I think your problem is in the other column labels expanding to fill the
> space from the name.
>
> Not all of the labels in your script need to be "-fill x". As fas as I
> can tell, only the first one, "name", needs to be that, and the rest
> should have a fixed size. You may also want to make sure that you
> configure "name" with "-expand 1" in addition to "-fill x".

Thank you for all the suggestions. But they didn't work. Nothing seems
to have changed.

--
Luc
>>

Re: Image in labels mess them all up

<goNgM.16948$kHz5.4104@fx15.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx15.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Subject: Re: Image in labels mess them all up
Content-Language: en-US
Newsgroups: comp.lang.tcl
References: <20230608204651.6ba8a233@lud1.home>
<0758a5be-bb81-4e06-b63b-718332bfa87an@googlegroups.com>
<20230609180654.2bb8266e@lud1.home>
From: Gerald.Lester@gmail.com (Gerald Lester)
In-Reply-To: <20230609180654.2bb8266e@lud1.home>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 76
Message-ID: <goNgM.16948$kHz5.4104@fx15.iad>
X-Complaints-To: abuse@fastusenet.org
NNTP-Posting-Date: Fri, 09 Jun 2023 22:07:08 UTC
Organization: fastusenet - www.fastusenet.org
Date: Fri, 9 Jun 2023 17:07:08 -0500
X-Received-Bytes: 3419
 by: Gerald Lester - Fri, 9 Jun 2023 22:07 UTC

On 6/9/23 16:06, Luc wrote:
> On Fri, 9 Jun 2023 00:04:08 -0700 (PDT), D Groth wrote:
>
>> Dear Luc,
>>
>> please post short code examples to show what your problem is. Nobody
>> will click usually on dubious image or video links. Having the code in
>> the group as well will help future readers of the message where the
>> video or the image link is already pointing to 404...
>>
>> Best,
>> Detlef
>
>
> Well, here is the code. But you don't have the SVG icon file.
>
>
> package require Tk
> load "/home/tcl/fm/libtksvg0.12.so"
> set file "/home/tcl/fm/icons/svg/folder_open3.svg"
> image create photo i1 -file $file -format {svg -scaletoheight 24}
>
> bind . <Escape> {exit}
> pack [frame .outerframe -bg #ffffff]
> pack [frame .outerframe.line0 -padx 0 -pady 0 -relief raised -bd 0 -bg #ffffff]
>
> set ::headings {
> line0 Name heading_name
> line0 Size heading_size
> line0 Modified heading_date
> line0 Permissions heading_perms
> line0 Owner heading_owner
> }
> foreach {line name col} $::headings {
> set w [button .outerframe.$line.$col -text $name -anchor w -relief raised -font {Arial 14} -width 10 -bd 1 -anchor center -padx 0 -pady 0]
> if {$col == "heading_name"} {.outerframe.$line.$col configure -width 50 -text "$name [subst -nocommands \\u25be]"}
> pack $w -side left -fill x
> }
> pack [frame .line1] [frame .line2] [frame .line3] [frame .line4]
>
> set ::data {
> line1 "File 1" name
> line1 "32.1 Mb" size
> line1 2023-05-05 date
> line1 755 perms
> line1 root:root owner
>
> line2 "File 2" name
> line2 "32.1 Mb" size
> line2 2023-05-05 date
> line2 755 perms
> line2 root:root owner
>
> line3 "File 3" name
> line3 "32.1 Mb" size
> line3 2023-05-05 date
> line3 755 perms
> line3 root:root owner
>
> line4 "File 4" name
> line4 "32.1 Mb" size
> line4 2023-05-05 date
> line4 755 perms
> line4 root:root owner
> }
> foreach {line name val} $::data {
> set w [label .$line.$val -text $name -anchor w -relief flat -font {Arial 14} -width 10 -fg #000000 -bg #ffffff -bd 2 -anchor center]
> if {$line == "line1"} {.$line.$val configure -bg #4A6984 -fg #ffffff}
> if {$val == "name"} {.$line.$val configure -width 50 -anchor w}
> pack $w -side left -fill x
> }

Use grid if you really want to roll your own table -- or better yet, use
one of the "table" widgets.

Re: Image in labels mess them all up

<u60enr$21qh6$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: saitology9@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Re: Image in labels mess them all up
Date: Fri, 9 Jun 2023 20:05:12 -0400
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <u60enr$21qh6$1@dont-email.me>
References: <20230608204651.6ba8a233@lud1.home> <u5vr7s$1vj5q$2@dont-email.me>
<20230609180753.410e291d@lud1.home>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 10 Jun 2023 00:05:16 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="18be1157baef0415cf0e05b122ea3946";
logging-data="2157094"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19wFOeziD0lvNrvkgwCmaSI"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:l+sCTCbnUF/3RuIp8a4YadtZxV4=
Content-Language: en-US
In-Reply-To: <20230609180753.410e291d@lud1.home>
 by: saitology9 - Sat, 10 Jun 2023 00:05 UTC

On 6/9/2023 5:07 PM, Luc wrote:
>
> Thank you for all the suggestions. But they didn't work. Nothing seems
> to have changed.
>

For buttons with text and images, you need to drastically increase the
width, not totally sure why.

If I increase the with to 650 as follows, everything lines up nicely
again.

if {$val == "name"} {$t.$line.$val configure -width 650 -anchor
w -image i1 -compound left}

Check out the image: https://0x0.st/HcSR.png

By the way, there are several table type widgets available to you as
packages. They might work better for you.

Re: Image in labels mess them all up

<u60nf1$26b39$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: Image in labels mess them all up
Date: Sat, 10 Jun 2023 02:34:09 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <u60nf1$26b39$1@dont-email.me>
References: <20230608204651.6ba8a233@lud1.home> <u5vr7s$1vj5q$2@dont-email.me> <20230609180753.410e291d@lud1.home> <u60enr$21qh6$1@dont-email.me>
Injection-Date: Sat, 10 Jun 2023 02:34:09 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="397a9d94eb1d3d616f357c3b30da2207";
logging-data="2305129"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ljvWI504HPdMzih+L2340"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.19 (x86_64))
Cancel-Lock: sha1:7wffKE/HcygViwBqXPZUPUfQCwM=
 by: Rich - Sat, 10 Jun 2023 02:34 UTC

saitology9 <saitology9@gmail.com> wrote:
> On 6/9/2023 5:07 PM, Luc wrote:
>>
>> Thank you for all the suggestions. But they didn't work. Nothing seems
>> to have changed.
>
> For buttons with text and images, you need to drastically increase the
> width, not totally sure why.

The /why/ is stated in the documentation:

man n button:

Command-Line Name:-width
Database Name: width
Database Class: Width

Specifies a desired width for the button. If an image or
bitmap is being displayed in the button then the value is
in screen units (i.e. any of the forms acceptable to
Tk_GetPixels). For a text button (no image or with
-compound none) then the width specifies how much space
in characters to allocate for the text label. ...

man n label:

Command-Line Name:-width
Database Name: width
Database Class: Width

Specifies a desired width for the label. If an image or
bitmap is being displayed in the label then the value is
in screen units (i.e. any of the forms acceptable to
Tk_GetPixels); for text it is in characters. ...

Note the part about "if an image or bitmap" and the resulting change in
default measurement units for "-width" when an image is present vs.
when text only is present.

Re: Image in labels mess them all up

<20230610133210.690c6a64@lud1.home>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: Image in labels mess them all up
Date: Sat, 10 Jun 2023 13:32:10 -0300
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <20230610133210.690c6a64@lud1.home>
References: <20230608204651.6ba8a233@lud1.home>
<u5vr7s$1vj5q$2@dont-email.me>
<20230609180753.410e291d@lud1.home>
<u60enr$21qh6$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="1433cc60b9b6877df92d6c2177b2e68b";
logging-data="2484282"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18V2m69KbnJ5ZeCZb9SYSK1/g05Qqt00xw="
Cancel-Lock: sha1:adfbb06ZnfCA4oNR/KRt41mMETc=
 by: Luc - Sat, 10 Jun 2023 16:32 UTC

On Fri, 9 Jun 2023 20:05:12 -0400, saitology9 wrote:

> For buttons with text and images, you need to drastically increase the
> width, not totally sure why.
> If I increase the with to 650 as follows, everything lines up nicely
> again.

Yes, I noticed that, except that I had to use 550 to make it look
correct. But Rich has solved that mystery.

> Check out the image: https://0x0.st/HcSR.png

Your heading buttons look very tall. Are you on Windows?

> By the way, there are several table type widgets available to you as
> packages. They might work better for you.

They might work, but not better for me. I think they are quite
complicated, and I am going to have to manage the code once the
application is out. I have to keep the code manageable within my
abilities. For example, I've tried to make drag and drop work with
those and I failed. I have to be realistic.

--
Luc
>>

Re: Image in labels mess them all up

<20230610133534.4bcc6e13@lud1.home>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: Image in labels mess them all up
Date: Sat, 10 Jun 2023 13:35:34 -0300
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <20230610133534.4bcc6e13@lud1.home>
References: <20230608204651.6ba8a233@lud1.home>
<0758a5be-bb81-4e06-b63b-718332bfa87an@googlegroups.com>
<20230609180654.2bb8266e@lud1.home>
<goNgM.16948$kHz5.4104@fx15.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="1433cc60b9b6877df92d6c2177b2e68b";
logging-data="2484282"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+jHnlpu7rZOsq8C9Wtf+QjrMUblZ5S3a0="
Cancel-Lock: sha1:x39PSgYoaxbaBqa7IoiC6d1LCkU=
 by: Luc - Sat, 10 Jun 2023 16:35 UTC

On Fri, 9 Jun 2023 17:07:08 -0500, Gerald Lester wrote:

> Use grid if you really want to roll your own table -- or better yet, use
> one of the "table" widgets.

The nice thing about [pack] is that I can [pack forget] a bunch of
widgets and not lose their configuration when I [pack] them again.
That is pretty valuable in an application with multiple tabs
(and an Undo Close Tab feature). Sadly, [grid] cannot do that.

The "table" widgets are too complicated for my taste. I will have
better control of the application without them.

--
Luc
>>

Re: Image in labels mess them all up

<20230610134422.7a3a78ac@lud1.home>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: Image in labels mess them all up
Date: Sat, 10 Jun 2023 13:44:22 -0300
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <20230610134422.7a3a78ac@lud1.home>
References: <20230608204651.6ba8a233@lud1.home>
<u5vr7s$1vj5q$2@dont-email.me>
<20230609180753.410e291d@lud1.home>
<u60enr$21qh6$1@dont-email.me>
<u60nf1$26b39$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="1433cc60b9b6877df92d6c2177b2e68b";
logging-data="2484282"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18KnTp7ReztofIsPZCUxCHWfbNs6+Yy8wc="
Cancel-Lock: sha1:dyrZrylImO8V0CW7PucLxxk8XxM=
 by: Luc - Sat, 10 Jun 2023 16:44 UTC

On Sat, 10 Jun 2023 02:34:09 -0000 (UTC), Rich wrote:

> The /why/ is stated in the documentation:
>
> man n button:
>
> man n label:

You are right again, of course.

Still confusing though because while the width measure/metric is
automatically changed to pixels, height seems to be still measured
in text characters.

I don't always understand Tk.

So looks like I am going to have to measure the icon's width which
will be variable because I'm using SVG and the label's text width
with [font metrics] and do some math.

Whether it will work to be seen. I'll let you know.

--
Luc
>>

Re: Image in labels mess them all up

<slrnu89elb.abkv.avl@logic.at>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: avl@logic.at (Andreas Leitgeb)
Newsgroups: comp.lang.tcl
Subject: Re: Image in labels mess them all up
Date: Sat, 10 Jun 2023 18:02:19 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <slrnu89elb.abkv.avl@logic.at>
References: <20230608204651.6ba8a233@lud1.home>
<0758a5be-bb81-4e06-b63b-718332bfa87an@googlegroups.com>
<20230609180654.2bb8266e@lud1.home> <goNgM.16948$kHz5.4104@fx15.iad>
<20230610133534.4bcc6e13@lud1.home>
Reply-To: avl@logic.at
Injection-Date: Sat, 10 Jun 2023 18:02:19 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1a5e8615fcd5b23de5fdef7b4b5349a9";
logging-data="2508240"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/P3lrYOrKl+z8WkXsSQmbi"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:KxQHnapR+2czDtzYIg5uTwJd9hw=
 by: Andreas Leitgeb - Sat, 10 Jun 2023 18:02 UTC

Luc <luc@sep.invalid> wrote:
> The nice thing about [pack] is that I can [pack forget] a bunch of
> widgets and not lose their configuration when I [pack] them again.
> That is pretty valuable in an application with multiple tabs
> (and an Undo Close Tab feature). Sadly, [grid] cannot do that.

grid also does have a subcommand "forget".

A few experiments seem to imply, that [pack forget] forgets
everything specific to the widget, same as [grid forget], so
I don't yet understand the preference for pack.

Could you expand on that a bit more?

Re: Image in labels mess them all up

<u62e58$2chig$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: Image in labels mess them all up
Date: Sat, 10 Jun 2023 18:07:36 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <u62e58$2chig$1@dont-email.me>
References: <20230608204651.6ba8a233@lud1.home> <u5vr7s$1vj5q$2@dont-email.me> <20230609180753.410e291d@lud1.home> <u60enr$21qh6$1@dont-email.me> <u60nf1$26b39$1@dont-email.me> <20230610134422.7a3a78ac@lud1.home>
Injection-Date: Sat, 10 Jun 2023 18:07:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="397a9d94eb1d3d616f357c3b30da2207";
logging-data="2508368"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+nj/Cd9Zagufb9hsWfgHXh"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.19 (x86_64))
Cancel-Lock: sha1:bpkZ/iCoLVk7Y1HjyWGknWAJKkE=
 by: Rich - Sat, 10 Jun 2023 18:07 UTC

Luc <luc@sep.invalid> wrote:
> On Sat, 10 Jun 2023 02:34:09 -0000 (UTC), Rich wrote:
>
>> The /why/ is stated in the documentation:
>>
>> man n button:
>>
>> man n label:
>
>
> You are right again, of course.
>
> Still confusing though because while the width measure/metric is
> automatically changed to pixels, height seems to be still measured
> in text characters.

The same "change" to a different unit is documented to occur for
-height as well:

Command-Line Name:-height
Database Name: height
Database Class: Height

Specifies a desired height for the button. If an image
or bitmap is being displayed in the button then the value
is in screen units (i.e. any of the forms acceptable to
Tk_GetPixels); for text it is in lines of text.

So unless you are seeing something different (possible) the addition of
an image to a button or label causes both -width and -height to be
"pixel based" measurements instead of "size of underlying font based"
measurements.

> So looks like I am going to have to measure the icon's width which
> will be variable because I'm using SVG

How so? Are you dynamically changing the size of the icon?

> and the label's text width with [font metrics] and do some math.

The [font measure ...] command is also useful here (at least for
-width values).

Re: Image in labels mess them all up

<20230610171137.6ab36b60@lud1.home>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: Image in labels mess them all up
Date: Sat, 10 Jun 2023 17:11:37 -0300
Organization: A noiseless patient Spider
Lines: 64
Message-ID: <20230610171137.6ab36b60@lud1.home>
References: <20230608204651.6ba8a233@lud1.home>
<0758a5be-bb81-4e06-b63b-718332bfa87an@googlegroups.com>
<20230609180654.2bb8266e@lud1.home>
<goNgM.16948$kHz5.4104@fx15.iad>
<20230610133534.4bcc6e13@lud1.home>
<slrnu89elb.abkv.avl@logic.at>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="b708ac84237ede68020d7d47ac1eab1d";
logging-data="2534757"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/J2qlhHQzYRd3Lzx8C8J2xfKCz3JP9AE="
Cancel-Lock: sha1:e0TDE0JpRawpfdF2ixcWeNT6MJw=
 by: Luc - Sat, 10 Jun 2023 20:11 UTC

On Sat, 10 Jun 2023 18:02:19 -0000 (UTC), Andreas Leitgeb wrote:

>grid also does have a subcommand "forget".
>
>A few experiments seem to imply, that [pack forget] forgets
>everything specific to the widget, same as [grid forget], so
>I don't yet understand the preference for pack.
>
>Could you expand on that a bit more?
>
**************************

Of course.

I may have been half right and half wrong.

Yes, grid also does have a subcommand "forget," but my copy of
the documentation (may be outdated) says:

pack forget slave ?slave ...?
Removes each of the slaves from the packing order for its master
and unmaps their windows. The slaves will no longer be managed
by the packer.

No mention of configuration, but I've been testing my application
using pack with tabs that contain multiple widgets that are
repeatedly "forgotten" and "remembered" and nothing is lost.

Documentation again:

grid forget slave ?slave ...?
Removes each of the slaves from grid for its master and unmaps
their windows. The slaves will no longer be managed by the grid
geometry manager. The configuration options for that window are
forgotten, so that if the slave is managed once more by the grid
geometry manager, the initial default settings are used.

This time, we see very specific language saying that widget
configuration *will* be lost. Will it though? I haven't tried.
I am (obviously) very used to using pack. I guess I will have
to test.

And there is this, which I hadn't noticed before:

grid remove slave ?slave ...?
Removes each of the slaves from grid for its master and unmaps
their windows. The slaves will no longer be managed by the grid
geometry manager. However, the configuration options for that
window are remembered, so that if the slave is managed once more
by the grid geometry manager, the previous values are retained.

Oh. Sounds like just what the doctor orderded. Again, I will
have to try.

--
Luc
>>

Re: Image in labels mess them all up

<20230610172514.628b47e7@lud1.home>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: luc@sep.invalid (Luc)
Newsgroups: comp.lang.tcl
Subject: Re: Image in labels mess them all up
Date: Sat, 10 Jun 2023 17:25:14 -0300
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <20230610172514.628b47e7@lud1.home>
References: <20230608204651.6ba8a233@lud1.home>
<u5vr7s$1vj5q$2@dont-email.me>
<20230609180753.410e291d@lud1.home>
<u60enr$21qh6$1@dont-email.me>
<u60nf1$26b39$1@dont-email.me>
<20230610134422.7a3a78ac@lud1.home>
<u62e58$2chig$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="b708ac84237ede68020d7d47ac1eab1d";
logging-data="2534757"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19LGlkNshkB54+uXugXZahrtkh/k1z1EOA="
Cancel-Lock: sha1:mx+JGaYdwzLsFaQdQxEG6eQMASw=
 by: Luc - Sat, 10 Jun 2023 20:25 UTC

On Sat, 10 Jun 2023 18:07:36 -0000 (UTC), Rich wrote:

>So unless you are seeing something different (possible) the addition of
>an image to a button or label causes both -width and -height to be
>"pixel based" measurements instead of "size of underlying font based"
>measurements.

Yes, I am seeing something different. When I insert the image and
change height from 1 to 2, it gets too tall, obviously twice as tall
as before the change. At 3, it begins to look ridiculous. It is
obviously not using pixels, but font height.

>> So looks like I am going to have to measure the icon's width which
>> will be variable because I'm using SVG
>
>How so? Are you dynamically changing the size of the icon?

Not yet. But I will.

My initial plan was to provide multiple sets of icons. I have 16,
20, 24, 32, 48, 64 and 128px icon sets. I never liked that, but
what else could I do? Well, then I discovered SVG support for Tk.
That is a game changer. Now the user can press + and - keys at will
and choose arbitrary icon sizes. I am not looking back.

Or maybe I am. I've already seen it's rather difficult to make the
entire file list scale along with the icons. The text size would
have to follow suit somehow, or maybe I should leave it to the user
to realize that they can only go so far with the resizing.

As they say on TV, to be continued...

--
Luc
>>

Re: Image in labels mess them all up

<u62t23$2eedr$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: et99@rocketship1.me (et99)
Newsgroups: comp.lang.tcl
Subject: Re: Image in labels mess them all up
Date: Sat, 10 Jun 2023 15:21:55 -0700
Organization: A noiseless patient Spider
Lines: 46
Message-ID: <u62t23$2eedr$1@dont-email.me>
References: <20230608204651.6ba8a233@lud1.home> <u5vr7s$1vj5q$2@dont-email.me>
<20230609180753.410e291d@lud1.home> <u60enr$21qh6$1@dont-email.me>
<u60nf1$26b39$1@dont-email.me> <20230610134422.7a3a78ac@lud1.home>
<u62e58$2chig$1@dont-email.me> <20230610172514.628b47e7@lud1.home>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 10 Jun 2023 22:21:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="19295f28eccbe491f10cdca1d590661d";
logging-data="2570683"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19FsUeZKjzSMUFTY2j0GUgW"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Cancel-Lock: sha1:0gb5kgaTDJ/ag82zxpkhpRD6IJA=
In-Reply-To: <20230610172514.628b47e7@lud1.home>
Content-Language: en-US
 by: et99 - Sat, 10 Jun 2023 22:21 UTC

On 6/10/2023 1:25 PM, Luc wrote:
> On Sat, 10 Jun 2023 18:07:36 -0000 (UTC), Rich wrote:
>
>> So unless you are seeing something different (possible) the addition of
>> an image to a button or label causes both -width and -height to be
>> "pixel based" measurements instead of "size of underlying font based"
>> measurements.
>
>
> Yes, I am seeing something different. When I insert the image and
> change height from 1 to 2, it gets too tall, obviously twice as tall
> as before the change. At 3, it begins to look ridiculous. It is
> obviously not using pixels, but font height.
>
>
>>> So looks like I am going to have to measure the icon's width which
>>> will be variable because I'm using SVG
>>
>> How so? Are you dynamically changing the size of the icon?
>
>
> Not yet. But I will.
>
> My initial plan was to provide multiple sets of icons. I have 16,
> 20, 24, 32, 48, 64 and 128px icon sets. I never liked that, but
> what else could I do? Well, then I discovered SVG support for Tk.
> That is a game changer. Now the user can press + and - keys at will
> and choose arbitrary icon sizes. I am not looking back.
>
> Or maybe I am. I've already seen it's rather difficult to make the
> entire file list scale along with the icons. The text size would
> have to follow suit somehow, or maybe I should leave it to the user
> to realize that they can only go so far with the resizing.
>
> As they say on TV, to be continued...
>
>

It sounds like you've found your grid vs. pack solution, but for future
reference, both have a [grid info window] or [pack info window] to retrieve
the current settings such that they could be restored using pack/grid configure.

I mostly use those for debugging, however.

Re: Image in labels mess them all up

<u63bir$2jiq8$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: Image in labels mess them all up
Date: Sun, 11 Jun 2023 02:29:47 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <u63bir$2jiq8$1@dont-email.me>
References: <20230608204651.6ba8a233@lud1.home> <u5vr7s$1vj5q$2@dont-email.me> <20230609180753.410e291d@lud1.home> <u60enr$21qh6$1@dont-email.me> <u60nf1$26b39$1@dont-email.me> <20230610134422.7a3a78ac@lud1.home> <u62e58$2chig$1@dont-email.me> <20230610172514.628b47e7@lud1.home>
Injection-Date: Sun, 11 Jun 2023 02:29:47 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="72b285fe1bb5ccee43ff46ba15a8934e";
logging-data="2739016"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19FzrmoLLWwSHPA4B1NJYCi"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.19 (x86_64))
Cancel-Lock: sha1:l/4ENYrsrjptelOFkJTf6YC8++s=
 by: Rich - Sun, 11 Jun 2023 02:29 UTC

Luc <luc@sep.invalid> wrote:
> On Sat, 10 Jun 2023 18:07:36 -0000 (UTC), Rich wrote:
>
>>So unless you are seeing something different (possible) the addition of
>>an image to a button or label causes both -width and -height to be
>>"pixel based" measurements instead of "size of underlying font based"
>>measurements.
>
>
> Yes, I am seeing something different. When I insert the image and
> change height from 1 to 2, it gets too tall, obviously twice as tall
> as before the change. At 3, it begins to look ridiculous. It is
> obviously not using pixels, but font height.

That is very interesting. I do not see the effect you see.

Code (this uses an image that is supplied as part of Tk itself):

$ rlwrap wish
% label .l -text Hello -image ::tk::icons::information -compound left
.l
% pack .l
% .l cget -height
0
% .l configure -height 1
% .l configure -height 2
% .l configure -height 3
% button .b -text Hello -image ::tk::icons::information -compound left
.b
% pack .b
% .b cget -height
0
% .b configure -height 1
% .b configure -height 2
% .b configure -height 3
%

And screenshots of the result of running the above commands are here
(all shots in one image):

https://0x0.st/Hcpi.png

I see what is documented to happen given what is written in the
manpages.


devel / comp.lang.tcl / Image in labels mess them all up

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor