You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am experimenting with a move from curses to prompt_toolkit (and some rich) and having fun so far. One thing that I need to present to the user is a bunch of pairs of data. They are paths and the free space on the associated disk. It is presently output as follows and adjusts the number of 'cells' on each row based on the overall width of the terminal.
It is not working beautifully or anything, but I share it to show one view of the idea. In general, I think the term 'flow layout' would be appropriate for what I want here. Or, alternatively, flowing the data through cells in a table. It might even be able to be viewed as a wrap feature with some control over exactly where the wrap can occur. Either way, there's a back and forth of sorts between the data size and the terminal size. The first few seconds of https://www.youtube.com/watch?v=pDqjHozkMBs show a flow layout. Note, I am a Qt/Python GUI dev significantly, not Java, but this video turned up quickly.
Does prompt_toolkit have any existing features to manage this? As mentioned, I can imagine that could be in the form of an ability to flow, an ability to control wrap points, or even just the ability to sensibly check the Window() width available for the content prior to creating the content and then I can manage the flow. The last point seems the simplest in terms of the demands on prompt_toolkit but I wasn't sure if there were caveats about doing that in combination with .invalidate() or similar potentially getting a different terminal size when they execute. That wouldn't be the end of the world, but if I can learn the proper way to handle the situation, that would be nice.
Thanks for any help you can offer to get me in the proper mindset to solve this well within the prompt_toolkit framework. For reference, my efforts are available at ericaltendorf/plotman#299 and can be run via the plotman prompt_toolkit command. Though, I don't actually expect anyone to run it. :]
The text was updated successfully, but these errors were encountered:
Hi, I am experimenting with a move from curses to prompt_toolkit (and some rich) and having fun so far. One thing that I need to present to the user is a bunch of pairs of data. They are paths and the free space on the associated disk. It is presently output as follows and adjusts the number of 'cells' on each row based on the overall width of the terminal.
It is not working beautifully or anything, but I share it to show one view of the idea. In general, I think the term 'flow layout' would be appropriate for what I want here. Or, alternatively, flowing the data through cells in a table. It might even be able to be viewed as a wrap feature with some control over exactly where the wrap can occur. Either way, there's a back and forth of sorts between the data size and the terminal size. The first few seconds of https://www.youtube.com/watch?v=pDqjHozkMBs show a flow layout. Note, I am a Qt/Python GUI dev significantly, not Java, but this video turned up quickly.
Does prompt_toolkit have any existing features to manage this? As mentioned, I can imagine that could be in the form of an ability to flow, an ability to control wrap points, or even just the ability to sensibly check the
Window()
width available for the content prior to creating the content and then I can manage the flow. The last point seems the simplest in terms of the demands on prompt_toolkit but I wasn't sure if there were caveats about doing that in combination with.invalidate()
or similar potentially getting a different terminal size when they execute. That wouldn't be the end of the world, but if I can learn the proper way to handle the situation, that would be nice.Thanks for any help you can offer to get me in the proper mindset to solve this well within the prompt_toolkit framework. For reference, my efforts are available at ericaltendorf/plotman#299 and can be run via the
plotman prompt_toolkit
command. Though, I don't actually expect anyone to run it.:]
The text was updated successfully, but these errors were encountered: