-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge shell into master to add Shell widget #63
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the current state, to me the widget feels unfinished. Then again, when I wanted to create a widget with similar functionality, it was intended to be pretty huge from the outset, so perhaps that is not what this widget is intended for in the first place.
There are some things I think must be addressed, but particularly the comments about functionality are kind of open. Just things to consider, not necessarily required, as they depend on what you want the widget to be able to do. I do think a catch-all is necessary, though.
from collections import defaultdict | ||
|
||
|
||
class Shell(tk.Canvas): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite some time ago I started implementing a similar widget on the Console
branch. Personally, I would add quite some features, including pressing up and down to cycle through command history, using the tab
to have some form of completion...
The textvariable
is modifiable by the creator of the widget, which inherently allows the creator to implement all these things. It is, however, not easy to do things with \b
or other special characters. Perhaps it is worth considering to implement these things in the base widget.
return | ||
|
||
def on_configure(self, event): | ||
padding = 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Ubuntu 20.04, GNOME, Python 3.8.2, a padding value of 4 makes the widget disappear until manually resized. A padding size of 2 solves this issue. I understand that this is here for stretching the widget to the size of its master, but, speaking from personal experience, this introduces head-aches like this when working with Canvases.
This code should be tested on different platforms in order to make sure that the widget does not resize itself out of visibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On windows, a padding of 2 makes the widget grow indefinitely
self.text_update() | ||
|
||
|
||
if __name__ == '__main__': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example has been moved to a separate file so may be removed here.
For new widgets only:
PR Details:
Description
A terminal-like shell widget
Checklist
/examples
/tests
AUTHORS.md