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

Improvement ideas for ttkwidgets #74

Open
rdbende opened this issue Feb 19, 2021 · 3 comments
Open

Improvement ideas for ttkwidgets #74

rdbende opened this issue Feb 19, 2021 · 3 comments

Comments

@rdbende
Copy link
Member

rdbende commented Feb 19, 2021

So I've been using the ttkwidgets library for a quite a long time, and I have some improvement, and modification ideas I'd like to share here. Unfortunately(?), it got a bit long.

Improvement ideas:

FontChooser:

image

  • Add a master option to the dialog, and make the chooser window transient
  • Change the sunken relief to solid to flatten it and make it look less 90-ish
  • Add an AutocompleteEntryListbox instead of a Label & Listbox for improve search (like in tkFontChooser)
  • Change the example text to something more useful, kikeThe quick brown fox (if it fits)

ColorChooser:

image

  • For appropriateness, change the HTML label to Hex
  • I recommend replacing the custom-styled tk.Spinboxes with a ttk.Spinbox
  • Add hex tooltips to the color-preset labels
  • For flatness, change the frame reliefs to solid
  • I would consider moving the 'Ok' and 'Cancel' buttons to the left side because it's much more common and handy if they are on the left
  • It would be good to have a regular indicator on the alphabar, and gradientbar, sometimes it's hard to spot the black line
    image

Calendar:

image

If you don't delete it:

  • Create a 'Today' button
  • Change the 'Previous' and 'Next' buttons to arrows, with Toolbutton style
  • I found a calendar widget here that uses many keyboard shortcuts for navigation, this can also be useful

LinkLabel:

image

  • Change the default hover-cursor from hand1 to hand2, it looks native (yes, even on Linux :). Maybe pointerhand on the Mac.

ItemsCanvas:

image

  • Change the movement cursor from exchange to fleur, it looks much more "moving"

ToolTip:

image
I agree with @Dogeek (Merge Tooltip from tkinterpp) tooltips usually have no title, and images. Today, tooltips look like this:
GitHub:
image
WinUI:
image

So, I would change this widget, because the current one doesn't look too good, and modern.

To display title labels and images, maybe buttons, TeachingTips are used these days, not ToolTips
image
image

Inconsistencies:

I think it’s a very good idea to collect widgets from various authors, but I think they should be standardized somehow. For example, there are very striking differences between askfont and askcolor, like that Askfont doesn't support master, askcolor do, but calls it parent (note that Tkinter uses master).

New widget ideas:

Here I couldn’t really decide what would fit in ttkwidgets because I don’t know what the concept of ttkwidgets actualky is.

  • To help with more complex widgets, or
  • to simplify the use of Tkinter with even basic widgets like a menubar.
    I think this second would be better because most people use Tkinter because they need a GUI, and for that, it's better to have such basic widgets at their disposal as well.

Simple widgets:

  • Switch
  • ToggleButton
  • AutoarrangeFrame - this is a very useful widget if you want to create a responsive gui (and usually you want)

Entries:

  • On-screen keyboard for entries. Example:
    image
  • Placeholder text for entries (perhaps with a hook like tooltips)
  • Tag entry

Not sure:

  • ContextMenu / PopupMenu
  • Menubar

Complex widgets:

  • TimePicker
  • Toolbar
  • Statusbar / Infobar
  • RichTextbox (with formatting-toolbar, or context menu with copy, paste, and formatting)
  • Custom messageboxes

This is a very good and useful package, so keep going!

@sbordeyne
Copy link
Member

It's a very long issue, so I'll drop in my thoughts as I go.

  • Charts : It's not necessary to implement charts in ttkwidgets, as it's already implemented comprehensively as part of matplotlib, which is a very mature and well-regarded library.
  • VideoPlayer : I thought about it, and it's impossible to do with python. At least, impossible to have decent framerates. The one you linked is my implementation, and it sucks performance wise. It's only good to display gifs at best
  • ContextMenu : I don't think that's a good idea, implementing a contextual menu is already very straightforward in standard tkinter. The only thing is that it doesn't look very modern. Honestly, if you're designing GUIs with tkinter, it should be obvious that you won't get the most modern and up to date GUI lookswise

That's about it for now

@RedFantom
Copy link
Member

Thank you both for taking the time to write up your thoughts. I agree with most of the suggestions, but my attention is currently focused elsewhere. Mostly I am studying, but when working on Tkinter-things I have been working on making Python packages out of tksvg and tkextrafont, in the scheme of a larger plan to make Tkinter look better than it does together with @rdbende .

Anyone is welcome to pick up any of these issues and open a PR for it, I'll be happy to review it. However, I won't have time to implement any of these things for what looks like is going to be months.

Lastly to chip in on the idea of a video player widget: Perhaps it would be possible to do this by building an implementation of a widget in C? Even writing a mock-up for that would be a lot of work though and it might still not provide the performance required to play a 30FPS video. There'd certainly have to be some reliance on an external library to decode the video in the first place, making compiling on multiple platforms quite a bit more complicated.

@rdbende
Copy link
Member Author

rdbende commented Mar 22, 2021

Thanks for the review! I started to implement some of these.
I also thought that the ContextMenu might actually not be necessary, I just wrote what came to mind, and as I mentioned earlier I'm not sure that MenuBar and ContextMenu and some others are actually necessary.

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

No branches or pull requests

3 participants