aesonus / tklife Goto Github PK
View Code? Open in Web Editor NEWMake TKinter life easier
License: MIT License
Make TKinter life easier
License: MIT License
For widgets that have a 'command' kwarg, a simple Event enumeration member can be passed in and the widgets method will create the command from the enumeration member such that the created widget will be the source of the event.
The SkeletonMixin class should configure its grid using settings returned by SkeletonMixin.grid_config
property method. IE:
class Frame(SkeletonMixin, Frame):
# ...
@property
def grid_config(self) -> tuple[Iterable[dict[str, Any]], Iterable[dict[str, Any]]]:
return (
[{"weight": 1}, {"weight": 1}], # Columns 0 and 1 has a weight of 1
[{}, {}, {"weight": 1}], # Row 2 has a weight of 1
)
Some custom widgets do not allow for certain options to be specified in the constructor, so this method is intended to allow the configuration of the widget after it has been instantiated.
SkeletonMixin._create_all
is handling creating widgets as well as configuring the grid. This should be separated out.
Affected code:
def _create_all(self):
"""Creates all the widgets in template."""
global_grid_args = self.__global_gridargs
for row_index, row in enumerate(self.template):
for col_index, skel_widget in enumerate(row):
w = self.__widget_create(skel_widget, row_index, col_index)
if w is None:
continue
self._grid_widget(
row_index, col_index, w, **global_grid_args, **skel_widget.grid_args
)
cols, rows = self.grid_config
for index, col in enumerate(cols):
if col:
self.columnconfigure(index, **col)
for index, row in enumerate(rows):
if row:
self.rowconfigure(index, **row)
Add a check for when an event funcid is not found, a key error is emitted.
The exception message when skeleton initialization fails does not mention where the template definition is. It would be very helpful to know which skeleton is actually raising the exception.
In the skeleton configuration of tkinter frames or frame-like widgets the variables will be done in a configuration style like the rest of the widgets and layout. This will require a special deferred creation object that will reference the actual tk variable upon widget creation.
A special Enum type will be used for generating and binding events to a widget
The master for the ModalDialog class needs to be set to the specified master in the constructor.
The init
and configure
method of SkelWidget should use a private instance variable to store the given Image object so python does not garbage collect it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.