jsteng has asked for the wisdom of the Perl Monks concerning the following question:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to write a vertical TK Entry?
by kcott (Archbishop) on Mar 05, 2020 at 08:43 UTC | |
G'day jsteng, To the best of my knowledge, you cannot do this with Tk::Entry; however, you can code this functionality with Tk::Text. The following code is fully functional. It shows how to set up the pseudo-entry widget (note the initial text has no spaces; just 12345). The "Latest Entry" button will retrieve the full, possibly edited, text (note the chomp) and update the display above.
It looks pretty weird to me, but that's what you asked for. :-) — Ken | [reply] [d/l] [select] |
|
Re: how to write a vertical TK Entry?
by Marshall (Canon) on Mar 05, 2020 at 06:35 UTC | |
In general, the pack() geometry manager is the easiest to use. The key is to make "invisible frames" that you pack other objects into. You can pack these "invisible frames" to the left, right, up, down of each other. It has been years since I did any significant GUI work, but hand drawing a sketch of what you want before writing the code is extremely helpful. Now an entry object will have a reference to a memory location of the entered data. I didn't show that and you didn't either. A lot of experimentation is required for writing a fancy GUI, but it certainly can be done! | [reply] [d/l] |
|
Re: how to write a vertical TK Entry?
by AnomalousMonk (Archbishop) on Mar 05, 2020 at 07:55 UTC | |
Don't know how to rotate the characters, but...
Give a man a fish: <%-{-{-{-< | [reply] [d/l] [select] |
|
Re: how to write a vertical TK Entry?
by Marshall (Canon) on Mar 05, 2020 at 11:54 UTC | |
This code provides 5 vertical entry fields which can be edited (that's what you can do to an entry field as opposed to a label or a button). You press the 'Print Values' button to see the edited values of these entry windows. I omitted the pack() details which can specify width, etc and also wrap around if desired. Tweaking these details can be time consuming. The main point here is whether or not I have the general idea of what you wanted? Update: I looked back at this code and it appears to me that you need some Label objects to the left of the "ENTRY" objects. Take a stab at that and let us know how you are doing. | [reply] [d/l] |
|
Re: how to write a vertical TK Entry?
by tybalt89 (Monsignor) on Mar 08, 2020 at 18:13 UTC | |
Out of half curiosity, half boredom, and half fun, I tried to build a (very incomplete) vertical entry from a Label widget using newlines to get a vertical display.
If nothing else, it shows a way to get a vertical column of text :)
| [reply] [d/l] |