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 <luc@sep.invalid> 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: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 59 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 03:45:59 |
| Calls: | 812 |
| Files: | 1,287 |
| D/L today: |
1 files (3,740K bytes) |
| Messages: | 210,189 |