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
Hi all!
I would like to build (since i haven't found a ready to use package)
a text-widget with dynamic scrollbars.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 406 |
Nodes: | 16 (2 / 14) |
Uptime: | 107:27:17 |
Calls: | 8,527 |
Calls today: | 6 |
Files: | 13,209 |
Messages: | 5,920,295 |