jarvisteach / appJar

Simple Tkinter GUIs in Python
http://appJar.info
Other
613 stars 68 forks source link

Incorporate new Grid/Graph widgets #152

Open slightlynybbled opened 7 years ago

slightlynybbled commented 7 years ago

The Grid widget shows up poorly

window

Very nice concept for the grid widget! Can't wait to see it working well! Once this is complete, I will probably move from tkinter completely.

jarvisteach commented 7 years ago

Entry widgets do look rubbish - should be an easy fix. Getting the container for the grid to fill its container should also be a straight-forward fix.

Managing the scroll panel is more difficult, and will take a bit more work - it should be using hide/show scrollbars that only appear as necessary, will need to investigate...

jarvisteach commented 7 years ago

If you manually set the size of the GUI window - you can have it not need the horizontal scroll bars.

The width of the GUI is set off the requested width of the widgets. The scroll pane (containing the grid) doesn't request a width, but rather takes what it's given - in the above example it has matched itself to the width of the previous widgets.

The scrollbars are always there, but are inactive when not needed, as you add rows the horizontal scrollbar will come into play...

jarvisteach commented 7 years ago

@slightlynybbled If you let me know what you're trying to achieve - I can look at adjusting the widget, to account for the use case...

slightlynybbled commented 7 years ago

@jarvisteach Thank you for looking at this! I love that tkinter is included with the standard python library, but it sometimes drives me nuts. Your lib - I suspect - will solve a lot of my distaste for tkinter.

I placed some comments is #151 to clarify my bugs.

I have been using tkinter for a bit and I ended up coding up a block (tkinter) that I have been able to use in a few places adequately. I am including it here:

grid.zip

Nice features:

You should be able to execute the file directly in any Python 3.5 environment (it has some type hints, requiring 3.5+) for a quick demo.

The styling doesn't look as nice as yours is, but it is workable.

Thanks again, brilliant work!

jarvisteach commented 7 years ago

Had a play with yours, it offers different functionality to mine - mine is a grid of Labels to show data, with the bottom row being Entries. By default, it is designed to just show a grid of data - with selectable Labels. Calling .getGridSelectedCells(title) will return all the selected cells. If you set action. If you set action you get a button at the end of each row - allowing you to select a row. If you then also set addRow you get the extra row of Entries, with their own Submit button...

It was built for a fairly specific use case, a long time ago!

Would you be open to me including your grid in appJar as an alternative to the existing one?

jarvisteach commented 7 years ago

Actually, upon closer inspection, it seems your grid does both Labels & Entries! Even better!

slightlynybbled commented 7 years ago

No problem at all. I wouldn't have shared it if it weren't shareable. I believe that the docstrings are reasonably adequate. Let me know if you have any questions.

I often need a display grid and a separate entry grid as opposed to a single entity containing all both. I toyed with the idea of disabling the entries to make a display grid at one point, but decided to go another direction, as you see. Enjoy!

slightlynybbled commented 7 years ago

I uploaded my tk_tools that I normally use to github for reference. The file that I sent to you is something of a snapshot, but not one to be trusted (I think I ended up finding an error in LabelGrid() since I sent that to you). These are just a few widgets that I have hacked together over some time and decided to put them in a nicer format for generic consumption. Feel free to take any of those. I'll do a pip install version soon.

jarvisteach commented 7 years ago

Thank you - I'm back at school now, preparing the kids for their end of year exams, so don't have much time for adding new features. But I'll definitely incorporate some of these into the library - I especially like the graphing widget as an alternative to matplotlib!

jarvisteach commented 7 years ago

Will raise new issue regarding scroll panes and sizing. Will rename this issue to incorporate new widgets. Other bits have been fixed.