-
Notifications
You must be signed in to change notification settings - Fork 29
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 or update calender widget #42
Comments
Well, having a single package full of widgets is always interesting. Even if installing packages is easy in python, it's still good to not have to "advertise" other packages, and have everything bundled into one (otherwise I'd be working on tkinterpp instead of trying to merge into ttkwidgets). Installing a whole package just for one widget seems wasteful. The other option is to create one package per widget, which makes the whole installation way more modular, but a pain in the ass to set up. |
The best thing about my implementation, is the variable flow which is very similar to tkinter's StringVar and IntVar for other widgets, which makes it easy to use when you're used to writing code for tkinter.
These are the variables I'd like to implement the flow for in ttkwidgets' widgets. I know it goes a bit out of the scope of this issue |
I have thought a bit about whether we should merge tkcalendar into ttkwidgets. One of the issue is that people use tkcalendar as a separate package and totally merging it into ttkwidgets would break dependencies in other people's projects. And given the github stats, this module is already used by a number of people. So I think that we could either choose one of the other calendars for ttkwidgets and make it a basic but functional widget, well integrated in the package or we could delete the calendar widget from ttkwidgets and I would transfer tkcalendar to the team as a separate package. |
Personally, I do not see any added benefit of having another complex If the @dogeek's implementation with I'll think about what I find to be the best option, but regardless, all widgets in the package should work in a similar way. |
@RedFantom I know having these With As for the Calendar widget implementation, I'm not opposed to scrapping the Calendars we made to the profit of @j4321 's # ttkwidgets/ttkwidgets/__init__.py
from tkcalendar import Calendar, DateEntry
# ttkwidgets/setup.py
...
install_requires=["pillow", "tkcalendar"] This would be the best of both worlds, you can just install ttkwidgets, and have access to a great Calendar widget, but tkcalendar still exists, so it doesn't break dependencies. |
@dogeek I agree with you that separating data from widgets is a good design practice. I have not always done so in the past and it is easier to just keep reference of a single object in some cases, but as soon as you start passing the data around, using a Variable is indeed easier. Variables are not flawless, however. For example, their behaviour when it comes to threads is non-obvious. This might be worth a consideration. While I have given the option of including |
The only problem I have with not having the Calendar widget in ttkwidgets is that it's a module that is not too popular in the first place (I mean, neither is ttkwidgets or tkinterpp to be honest), so it's kind of hard to find, hence having just one module with everything included is quite desirable. Ultimately, it's your choice. I like my implementation of the Calendar widget (given that I use buttons directly, and use a tkinter-like Variable to hold the date), which is really easy to style, and use (in my opinion). If we were to keep a Calendar, I'd move that my implementation is slightly better than the one in ttkwidgets, and that we should use it, albeit replacing the tk.Button widgets with ttk.Button ones. If we scrap it then fine, but tkcalendar should be included in the TkinterEP team repos. I understand that Variables have their flaws, but my own implementations are pure python, and wouldn't cause Thread lock issues, unlike the default tkinter ones. They are really handy to separate Data from Actions after all. |
Right now there are four calender widgets for Tkinter that I know of which all contain a set of features which might be interesting to have.
ttkwidgets version
A simple date picker, really. Built using a Canvas, which results in a pretty compact design. Not many options. Lacks a callback for when a new date is selected.
tkcalendar
A separate package containing an excellent, compactly styles, calendar widget with a huge amount of options, maintained by @j4321 .
tkinterpp version
A Calendar using buttons instead of a Canvas. Uses the
Tk
widget set currently and atk.Variable
-like variable for storing the date.gsf-parser version
For the GSF Parser I have developed a widget based on the widgets contained in this package. It acts also as a heatmap. It may be found here.
Which of these widgets should be in the package is the big question here. tkcalendar could be included in an of itself, but I am not sure whether that would be beneficial to that project. Could you give your opinion on this, @j4321?
All in all, I think it might actually be best to remove the Calendar widget from
ttkwidgets
altogether and just point totkcalendar
. It is by far the best widget out there for this purpose that I know of and building something that does all those things in parallel seems like a waste of time and resources. The only thing I can think off that could be added to tkcalendar is offering multiple colour schemes in the widget itself.The text was updated successfully, but these errors were encountered: