Git Product home page Git Product logo

ctkgridlayout's Introduction

CTkGridLayout

Simple grid view module for customtkinter library

BASE SCROLLABLE
Screenshot Screenshot
examples/grid_view.py examples/scrollable_grid_view.py

How to install

pip install https://github.com/nkeff/CTkGridLayout/releases/download/v.0.1.0/ctkgridlayout-0.1.0-py3-none-any.whl

or

  1. copy ctk_grid_layout.py file in your project
  2. You must have customtkinter library installed

Usage

import customtkinter

from ctkgridlayout import CTkGridLayout

if __name__ == "__main__":
    root = customtkinter.CTk()
    root.geometry("640x480")
    root.grid_columnconfigure(0, weight=1)
    root.grid_rowconfigure(0, weight=1)

    GRID_VIEW = CTkGridLayout(master=root, column_count=2, spacing=15, padding=50)
    GRID_VIEW.add_items([
        customtkinter.CTkLabel(GRID_VIEW, text='first', fg_color='green'),
        customtkinter.CTkLabel(GRID_VIEW, text='second', fg_color='green'),
        customtkinter.CTkLabel(GRID_VIEW, text='third', fg_color='green'),
        customtkinter.CTkLabel(GRID_VIEW, text='fourth', fg_color='green'),
        customtkinter.CTkLabel(GRID_VIEW, text='fifth', fg_color='green'),
    ])
    GRID_VIEW.grid(row=0, column=0, sticky="nsew")
    root.mainloop()

Screenshot

Methods

  • .add_item(item: customtkinter.CTkBaseClass): add new item in grid frame
  • .add_items(items: list[customtkinter.CTkBaseClass]): add list of items, update function call once
  • .update_layout(column_count: int = None, spacing: int = None, padding: int = None): update layout (change column count view, paddings and spacing between items

Property

  • .items: items list in grid frame
  • .items_count: count of items in grid frame

ctkgridlayout's People

Contributors

nkeff avatar

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.