DEV Community

Cover image for I built wordle for desktop but using my own GUI library!
Scriptor
Scriptor

Posted on

I built wordle for desktop but using my own GUI library!

Developing desktop GUIs in Python often involves frameworks that are either low-level or restrictive. To address this, I created PyUIKit, a open source project and a component-based Python GUI library built on top of CustomTkinter. Its goal is to provide a web-like, simple syntax for building GUIs efficiently. I'm trying to actively update PyUIkit, even though its not polished its usable.

To test the library, I built a desktop Wordle clone, which helped identify current limitations and areas for improvement.


Watch the Full Walkthrough

If you wanna watch the full process of how I built it then watch this:

Overview

The desktop Wordle app includes:

  • Six attempts to guess a five-letter word
  • Random word selection from a list of 450+ words
  • Color-coded tiles for feedback: green ✅, yellow ⚠️, gray ❌
  • Toast notifications for user feedback

ScreenShot of wordle


PyUIKit GUIs

With PyUIKit, UI components are composed in a nested, web-like structure:

from pyuikit import Body, Div, Input
from pyuikit.components import Text, Button

app = Body(resizable=(False, False), height=600, width=800, title='Wordle')

Div(
    height=600,
    width=800,
    bg_color='#121213',
    children=[
        Text(text="WORDLE", font_size=30, color="white"),
        Div(horizontal=True, nested=True, children=[
            Input(id='row1_col1', width=50, height=50, multiline=True),
            Button(text="Submit", on_click=lambda: handlesubmit(1))
        ])
    ]
)

app.run()
Enter fullscreen mode Exit fullscreen mode

Handling Wordle Logic

def handlesubmit(rownum):
    letters = [Input.get_input_text(f'row{rownum}_col{i+1}') for i in range(5)]
    # Two-pass check: green first, then yellow/gray
    # Toast feedback if correct or attempt used
Enter fullscreen mode Exit fullscreen mode

Limitations discovered

  • Single-line Input components cannot have custom heights
  • Font customization is limited
  • Dynamic background color updates are not fully supported

Future Improvements for PyUIKit

  • Easier, more concise update functions
  • Better Div layouts for flexible UI composition
  • Improved input handling, styling, and responsiveness

Conclusion

This Wordle project served as a practical stress test to identify PyUIKit’s current limitations and guide its evolution. While PyUIKit may not yet compete with more mature GUI frameworks, it is under active development, and projects like this play a crucial role in uncovering weaknesses, refining APIs, and shaping future improvements.

If you like the project please consider giving us a star on the github repo.

PyUIKit links:

Top comments (0)