MultilineTextInput is very basic #3834
Replies: 3 comments 2 replies
|
You're correct that the MultilineTextInput doesn't currently have any APIs for changing only part of the text, controlling or detecting the cursor position, or detecting the user's edits in the form "inserted X at position Y". Based on those limitations, I think the best way to use it in a terminal emulator would be to make the MultilineTextInput read-only, have a separate editable TextInput below it with an If you have an Android phone, the Python console in the Chaquopy demo app is the kind of thing I'm talking about. Unfortunately its source code probably isn't useful to you because it doesn't use Toga, and isn't even written in Python. |
|
Thanks for your quick reply! The idea of a separate command widget sounds good especially for mobile (always right above the keyboard). BTW I tried installing your app only to find out I already had it - excellent app! Should I be concerned about updating the value property often (every time an ssh session emits something) - over time it can be a few thousands lines? The other question is about colors (to highlight commands, errors, search results, etc)... Are you aware about short term plans to add a bit more advanced functionality? Any plans to support some kind of markup language like Markdown? |
|
Thanks for your quick reply! As for the contributions, I do not think I am the right person for writing code - I have not written any serious code for over 25 years. However I can try to contribute with reporting issues, spreading good words (, and requesting features :)). Honestly I see BeeWare as my attempt to get into the Python world. My current job is not related to programming, but from time to time I do write some code to help me better serve customers (and so far since I am familiar with Tcl/Tk that was easier for me and prevented from learning new things). So far my experience with BeeWare is quite positive. I watched a few videos and listened to a podcast and found not only interesting (and simple to start) technology but also the right energy. I faced and resolved a few issues during the installation. How can I share the experience and the fixes? For example when installing on a corporate Windows 11 machine, I initially tried Python 3.14, but some components were missing so I switched to 3.13. Then noticed other issues and was able to resolve by disabling VPN (temporarily - corp policy would re-enable it in 30 min). Your doc only mentioned disabling Antivirus, which I could not do. Maybe it makes sense to mention VPN as well. Another example was Chromebook. Google offers a quite outdated Debian and Toga failed to install due to missing packages. I modified the distribution sources.list file to point to the latest version and had no problem installing both Toga and Briefcase. Is it useful info? |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I was looking into using toga for an ssh app (like putty). I have a similar app already implemented in Tcl/Tk, which uses the Tk text widget for a terminal window.
It seems the best existing toga widget for the task is MultilineTextInput, but if I understand correctly it only supports one on_change() callback and a value property.
In order implement terminal I do not need too much, but a minimum I need the following:
Both things are kind of possible, but having only on_change() and value makes the implementation quite ugly and very inefficient.
It seems toga uses quite sophisticated text widgets for every platform, but still limited to a very basic functionality.
Am I right in my conclusions?
Maybe it is better for my task to stick with Tkinter, where the text widget is very feature rich...
Thanks,
Michael
All reactions