Skip to content
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

Allow any Container subclass to receive focus inside Layout, and some other suggestions #1932

Open
zokrezyl opened this issue Oct 21, 2024 · 0 comments

Comments

@zokrezyl
Copy link

zokrezyl commented Oct 21, 2024

While one can add non Window containers to the Layout, apparently the design forces the children to be Window objects. I believe this is a little artificial limitation. The Window implementation provides great features, in some edge cases it shows it's limitations. I know that technically I can override all the Container abstract methods, but semantically that would be a little mess.

In my particular case I want to handle fast logginng scrolling into a window and different text formatting mechanism.

Some other enhancement suggestions:

  • The _Split window_to_small could/should be also of type Callable. The information could be used somewhere else, including logging, or displaying it in a dedicated space on the screen
  • Saw several issues with wishes to be able to write_raw to the terminal (through screen). While one could always write directly to the stdout the escape sequences, that would bypass the normal rendering flow. I know the powerfull screen diffing mechanism, but again for my "fast scrolling" interface and other purposes I would like to bypass the diff for the region of my "renderable". I guess the simplest solution would be when doing the diff for a line to look into an "exception dict" if there is an entry for that line, if yes, check if the current character position is in any of the ranges for that entry. If yes, just call write_raw. I know that technically I could use the ZeroWdithEscape buffer, but again semantically would be a hack.

I know this might create some headache for you as it may mess up the screen and produce unwanted issues, but that would be the responsability of the user to add to the "exception ranges dict"

Another use-case would be a terminal emulator inside a PT appication like ptterm. Converting the escape sequences to fragments and then back to raw is a bit of overhead, especially if you want again, fast scrolling inside the virtual terminal.

Thanks,
Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant