Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Fascinating is a word I use for the unexpected. -- Spock, "The Squire of Gothos", stardate 2124.5


devel / comp.lang.tcl / Re: scrollutil an text-Widgets

SubjectAuthor
* scrollutil an text-WidgetsMatthias Meier
+- Re: scrollutil an text-WidgetsRich
`- Re: scrollutil an text-Widgetsnemethi

1
scrollutil an text-Widgets

<da2254fc-dc82-4899-9770-af93111ed493n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:622a:652:b0:403:fd62:ceb0 with SMTP id a18-20020a05622a065200b00403fd62ceb0mr7035qtb.12.1690387430318;
Wed, 26 Jul 2023 09:03:50 -0700 (PDT)
X-Received: by 2002:a4a:4146:0:b0:566:34f5:2cf0 with SMTP id
x67-20020a4a4146000000b0056634f52cf0mr3192971ooa.1.1690387429913; Wed, 26 Jul
2023 09:03:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Wed, 26 Jul 2023 09:03:49 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=87.130.65.51; posting-account=chTr3AoAAABkVLsODv9wti58Lk9Gr9as
NNTP-Posting-Host: 87.130.65.51
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <da2254fc-dc82-4899-9770-af93111ed493n@googlegroups.com>
Subject: scrollutil an text-Widgets
From: diemeiers21@googlemail.com (Matthias Meier)
Injection-Date: Wed, 26 Jul 2023 16:03:50 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 39
 by: Matthias Meier - Wed, 26 Jul 2023 16:03 UTC

Hi all!

I would like to build (since i haven't found a ready to use package) a text-widget with dynamic scrollbars.
I want to get the scrollbars only, when the text within the text-widget is larger then the visible part of the widget.
I thought it would be a good idea to use "scrollutil" for, instead building it from scratch.
But either the scrollbars are shown when the toplevel gets smaller then the text-widget (not the text) or the scrollbars are shown never. (depending on -fitcontentwidth/-fitcontentheight)

Is it possible to archive this goal with the scrollutil-package or do i have to build a megawidget myself? (canvas+text+scrollbars)

Here is my sample code:

----------------------------------------------------
package require scrollutil

toplevel .t

scrollutil::scrollarea .t.sa
scrollutil::scrollableframe .t.sa.sf
..t.sa setwidget .t.sa.sf

set cf [.t.sa.sf contentframe]

text $cf.t -wrap none

$cf.t insert 1.0 "this is a text line in a text widget\nanother line"

grid .t.sa -row 0 -column 0 -sticky nesw
grid columnconfigure .t 0 -weight 1
grid rowconfigure .t 0 -weight 1

grid $cf.t -row 0 -column 0 -sticky nesw
grid columnconfigure $cf 0 -weight 1
grid rowconfigure $cf 0 -weight 1

# .t.sa.sf configure -fitcontentwidth 1
# .t.sa.sf configure -fitcontentheight 1

Thank you very much,
Matthias

Re: scrollutil an text-Widgets

<u9ri6t$1hrck$1@dont-email.me>

  copy mid

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

  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: scrollutil an text-Widgets
Date: Wed, 26 Jul 2023 16:38:53 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 10
Message-ID: <u9ri6t$1hrck$1@dont-email.me>
References: <da2254fc-dc82-4899-9770-af93111ed493n@googlegroups.com>
Injection-Date: Wed, 26 Jul 2023 16:38:53 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a320f81c0ccf6af9ce990c32587bf140";
logging-data="1633684"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Uvag4ZsBfEGmsVxfLrJzs"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.19 (x86_64))
Cancel-Lock: sha1:7F0jNecFB9tmiUE4Vz7fUu5ABoU=
 by: Rich - Wed, 26 Jul 2023 16:38 UTC

Matthias Meier <diemeiers21@googlemail.com> wrote:
> Hi all!
>
> I would like to build (since i haven't found a ready to use package)
> a text-widget with dynamic scrollbars.

Does the 'autoscroll' package in TkLib not fit your needs?

https://core.tcl-lang.org/tklib/doc/trunk/embedded/md/tklib/files/modules/autoscroll/autoscroll.md

Re: scrollutil an text-Widgets

<u9rjcp$bfj5$1@tota-refugium.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.tota-refugium.de!.POSTED!not-for-mail
From: csaba.nemethi@t-online.de (nemethi)
Newsgroups: comp.lang.tcl
Subject: Re: scrollutil an text-Widgets
Date: Wed, 26 Jul 2023 18:59:05 +0200
Message-ID: <u9rjcp$bfj5$1@tota-refugium.de>
References: <da2254fc-dc82-4899-9770-af93111ed493n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 26 Jul 2023 16:59:05 -0000 (UTC)
Injection-Info: tota-refugium.de;
logging-data="376421"; mail-complaints-to="abuse@news.tota-refugium.de"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:QfglFnSU8vgfW+cSaVIrWdwU22k=
In-Reply-To: <da2254fc-dc82-4899-9770-af93111ed493n@googlegroups.com>
Content-Language: en-US
X-User-ID: eJwFwYEBwCAIA7CXhtAyznF1/f8EEySD6iJYMOxTHYrZ9Tfl4bcES+vdz2hoyJETUJyV9AUrChFv
 by: nemethi - Wed, 26 Jul 2023 16:59 UTC

Am 26.07.23 um 18:03 schrieb Matthias Meier:
> Hi all!
>
> I would like to build (since i haven't found a ready to use package) a text-widget with dynamic scrollbars.
> I want to get the scrollbars only, when the text within the text-widget is larger then the visible part of the widget.
> I thought it would be a good idea to use "scrollutil" for, instead building it from scratch.
> But either the scrollbars are shown when the toplevel gets smaller then the text-widget (not the text) or the scrollbars are shown never. (depending on -fitcontentwidth/-fitcontentheight)
>
> Is it possible to archive this goal with the scrollutil-package or do i have to build a megawidget myself? (canvas+text+scrollbars)
>
> Here is my sample code:
>
> ----------------------------------------------------
> package require scrollutil
>
> toplevel .t
>
> scrollutil::scrollarea .t.sa
> scrollutil::scrollableframe .t.sa.sf
> .t.sa setwidget .t.sa.sf
>
> set cf [.t.sa.sf contentframe]
>
> text $cf.t -wrap none
>
> $cf.t insert 1.0 "this is a text line in a text widget\nanother line"
>
> grid .t.sa -row 0 -column 0 -sticky nesw
> grid columnconfigure .t 0 -weight 1
> grid rowconfigure .t 0 -weight 1
>
> grid $cf.t -row 0 -column 0 -sticky nesw
> grid columnconfigure $cf 0 -weight 1
> grid rowconfigure $cf 0 -weight 1
>
> # .t.sa.sf configure -fitcontentwidth 1
> # .t.sa.sf configure -fitcontentheight 1
>
>
> Thank you very much,
> Matthias

The code needed for a a text-widget with dynamic scrollbars is much
simpler (it doesn't use any scrollableframe):

package require scrollutil

toplevel .t

scrollutil::scrollarea .t.sa
text .t.sa.t -wrap none
..t.sa setwidget .t.sa.t

..t.sa.t insert 1.0 "this is a text line in a text widget\nanother line"

grid .t.sa -row 0 -column 0 -sticky nesw
grid columnconfigure .t 0 -weight 1
grid rowconfigure .t 0 -weight 1

--
Csaba Nemethi https://www.nemethi.de mailto:csaba.nemethi@t-online.de


devel / comp.lang.tcl / Re: scrollutil an text-Widgets

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor