TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Python Universal GUI (tkinter, wxwidgets, winforms with shoes-like syntax)

12 pointsby Alcidesover 16 years ago

1 comment

etalover 16 years ago
Some discussion:<p>1. Python's object-oriented syntax makes it tedious to hand-code a complete GUI app. Instantiate a container, add a label, set the label text, add button, add a button -- without special hackmagic (e.g. fussing with __dict__ and __getattr__), it's very repetitive and not particularly readable. Basically, it looks like Java. Special hacks can cut the redundancy, but then, simple GUI layout code shouldn't be that conceptually tricky.<p>When I started using Glade alongside GTK, life improved dramatically. Separating the layout from the controlling methods seems to be part of it, and that works fine in web apps, so it's nicely familiar. But XML sucks for simply storing and retrieving data within an app, and I don't think the layout and logic need to be written in different languages necessarily. XML and HTML work for layout because the code physically looks like the layout it describes -- angle brackets don't matter; parentheses would be fine too.<p>In short, I think the syntax we want for GUI layout should be declarative, not object-oriented. Ruby's blocks make it work for Shoes, and I'm suspicious that converting that style to Python's OOP syntax without understanding the need for a sort of declarative mini-language will lead to... let's say, a confusing and ugly API.<p>2. Is this (a) a library that's either pre-installed on the user's machine or included with the distributed code, (b) a framework that generates code for the target platform during design, or (c) a preprocessor that generates the right platform-specific code before/during packaging?<p>3. I understood that Clutter was the new hotness in GUI creation these days. Any interaction there?
评论 #284574 未加载