Giter Site home page Giter Site logo

tklife's People

Contributors

aesonus avatar

Watchers

 avatar  avatar  avatar

tklife's Issues

Command Kwarg Late Binding

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.

Add grid_config property to SkeletonMixin classes

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
        )

Use protected methods for each stage of SkeletonMixin initialization.

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)

Widget Initialize Exception Message

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.

Variable Containers

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.

Events Enumeration

A special Enum type will be used for generating and binding events to a widget

Binding Event methods

  • bind method
  • bind_all method
  • bind_class method

Generating event methods

  • generate

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.