Has anybody ever devised a clever way to simulate ruled paper in a
text widget?
I've been searching high and low and can't find anything.
So I figured that if I make the text widget background all black,
then use tags to make all lines have white background and - here is
the trick - create some very thin spacing between the lines, the
black background will show through the spacing and everything will
look like thin black lines across a white background.
But I am here asking, so of course it's not working.
Canvas won't work either, I need the real deal text widget in all
its legendary glory, and the ruled lines have to scale with varying
font size.
Is there a way?
TIA,
There's a solution somewhere in the wiki using `place`. I can't find it >again, though.
Here's another way, also using `place`, but with only one font at a time.
https://github.com/gregnix/ruledtext**************************
Gregor
On Mon, 2 Mar 2026 00:23:05 +0100, greg wrote:
There's a solution somewhere in the wiki using `place`. I can't find it >again, though.
Here's another way, also using `place`, but with only one font at a time.
https://github.com/gregnix/ruledtext
Gregor**************************
Thank you! That should do it.
Luc <[email protected]d> posted:
On Mon, 2 Mar 2026 00:23:05 +0100, greg wrote:
There's a solution somewhere in the wiki using `place`. I can't find it >again, though.
Here's another way, also using `place`, but with only one font at a time.
https://github.com/gregnix/ruledtext
Gregor**************************
Thank you! That should do it.
Have you tried with -bgstipple? This puts a bitmap into the background
of the text widget and with a suitably filled bitmap, you should be able to get the ruling that you need. At least, that is what I think will happen,
I have not tried it myself :).
Have you tried with -bgstipple? This puts a bitmap into the background
of the text widget and with a suitably filled bitmap, you should be able
to get the ruling that you need. At least, that is what I think will
happen, I have not tried it myself :).
It turns out to be an option for the tags, so not an option for the
text widget as a whole.
This script does give an idea of what it might look like:
pack [text .t]
.t tag configure X -bgstipple error -background green
.t insert end "AAAA" X
Am 28.02.26 um 02:50 schrieb Luc:
Has anybody ever devised a clever way to simulate ruled paper in a
text widget?
I've been searching high and low and can't find anything.
So I figured that if I make the text widget background all black,
then use tags to make all lines have white background and - here is
the trick - create some very thin spacing between the lines, the
black background will show through the spacing and everything will
look like thin black lines across a white background.
But I am here asking, so of course it's not working.
Canvas won't work either, I need the real deal text widget in all
its legendary glory, and the ruled lines have to scale with varying
font size.
Is there a way?
TIA,
There's a solution somewhere in the wiki using `place`. I can't find it again, though.
Here's another way, also using `place`, but with only one font at a time.
https://github.com/gregnix/ruledtext
Gregor
| Sysop: | DaiTengu |
|---|---|
| Location: | Appleton, WI |
| Users: | 1,099 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 492379:03:15 |
| Calls: | 14,106 |
| Calls today: | 2 |
| Files: | 187,124 |
| D/L today: |
2,541 files (1,098M bytes) |
| Messages: | 2,496,242 |