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.

Toga: A Python native, OS native GUI toolkit

149 pointsby samfalmost 11 years ago

13 comments

WoodenChairalmost 11 years ago
This project appears to be quite early stage (many missing APIs, no stable Windows support, poor documentation, etc) but very promising. If it had integration with a GUI designer and was feature complete, I&#x27;d start using it on projects.<p>I&#x27;ve explored the options for Python GUI toolkits quite extensively. They&#x27;re a real challenge to get running conveniently (by conveniently, I mean a simple PIP install away with no external C&#x2F;C++ library dependencies) on OS X with native looks, and that is a nice advantage of this one IMHO.
评论 #8159065 未加载
评论 #8159875 未加载
malkiaalmost 11 years ago
Another toolkit that uses Python, but with Qt (and previously also wxWidgets) is enaml - it has a cassowary solver, a Visual Studio docking system, and very interesting approach to connecting that to visual elements.<p><a href="https://github.com/nucleic/enaml" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;nucleic&#x2F;enaml</a><p><a href="http://nucleic.github.io/enaml/docs/" rel="nofollow">http:&#x2F;&#x2F;nucleic.github.io&#x2F;enaml&#x2F;docs&#x2F;</a>
评论 #8158353 未加载
评论 #8159066 未加载
Camilloalmost 11 years ago
The Mac screenshot I see on the home page looks about as non-native as the average Qt app.
评论 #8158747 未加载
评论 #8158134 未加载
评论 #8159024 未加载
rkangelalmost 11 years ago
For a project like this where there are many other potential options (wxPython etc.) the first question I&#x27;m thinking is &#x27;why do I care about this new one&#x27;. I.e. What does this do better&#x2F;differently&#x2F;more conveniently. I assume the answer here us the native Python aspect and not needing big compiled libraries. Might be worth selling it a bit more on your homepage and making that advantage clearer?<p>It may be that everyone else picked up on Python native quicker than I did, I&#x27;m reading this in bed during a lie in so am a bit sleepy!
评论 #8159505 未加载
atanasbalmost 11 years ago
This looks promising. It would be better if the documentation was a bit more exhaustive[0]<p>[0]<a href="http://toga.readthedocs.org/en/latest/internals/platforms/desktop/cocoa.html" rel="nofollow">http:&#x2F;&#x2F;toga.readthedocs.org&#x2F;en&#x2F;latest&#x2F;internals&#x2F;platforms&#x2F;de...</a>.
评论 #8159060 未加载
rjn945almost 11 years ago
I was really confused when I read &quot;the constrain() call takes <i>expressions</i> that define the relationships you want to impose&quot; (emphasis mine) and saw this code:<p><pre><code> container.constrain(button.TOP == container.TOP + 50) </code></pre> Python doesn&#x27;t let you pass expressions! Why isn&#x27;t that just getting evaluated to true or false? Is this not vanilla Python? Is there a pre-processor?<p>I dove into the code and found the answer here[1]. button.TOP and container.TOP are both Toga Attributes, which have their equality operators redefined.<p>Very interesting and clever use of operator overloading.<p>[1] <a href="https://github.com/pybee/toga/blob/master/toga/constraint.py" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pybee&#x2F;toga&#x2F;blob&#x2F;master&#x2F;toga&#x2F;constraint.py</a>
评论 #8159395 未加载
评论 #8160094 未加载
评论 #8159047 未加载
评论 #8159035 未加载
评论 #8159214 未加载
davidjhallalmost 11 years ago
<p><pre><code> left_container = toga.OptionContainer() AttributeError: &#x27;module&#x27; object has no attribute &#x27;OptionContainer&#x27; </code></pre> Frustrating when things that are supposed to work out of the box, don&#x27;t. Initial search yields no help.
评论 #8159074 未加载
评论 #8158954 未加载
allegoryalmost 11 years ago
Very interesting. They have other tools which are rather useful looking as well: <a href="http://pybee.org/" rel="nofollow">http:&#x2F;&#x2F;pybee.org&#x2F;</a> (debugger, test runner, coverage visualiser etc)
评论 #8159091 未加载
roryokanealmost 11 years ago
Does anyone know of any similar GUI toolkits, for languages other than Python? That is, cross-platform GUI toolkits that use true OS-native widgets, and ideally, also abstract away platform-specific details such as the placement of the Quit&#x2F;Exit menu items and the order of OK&#x2F;Cancel buttons. Toga is actually the first library with those features that I’ve heard of.
评论 #8158155 未加载
评论 #8158446 未加载
评论 #8161456 未加载
calpatersonalmost 11 years ago
The use of constraints to let the user specify where to put things but still allow enough flexibility to do OS-dependant things is interesting (and possibly novel?):<p><a href="http://toga.readthedocs.org/en/latest/introduction/tutorial-0.html" rel="nofollow">http:&#x2F;&#x2F;toga.readthedocs.org&#x2F;en&#x2F;latest&#x2F;introduction&#x2F;tutorial-...</a>
评论 #8158029 未加载
评论 #8157999 未加载
评论 #8158011 未加载
评论 #8157977 未加载
评论 #8158610 未加载
评论 #8158068 未加载
ymesheshaalmost 11 years ago
This toolkit seems extremely simple and user-friendly, might have to give it a try
theophrastusalmost 11 years ago
loutish&#x2F;lazy Debian&#x2F;&quot;testing&quot; system here:<p><pre><code> ~&gt; apt-cache search toga toga2 - computer chess engine, calculates chess moves </code></pre> (hm... wake me when it hits testing)
评论 #8159093 未加载
评论 #8159915 未加载
analog31almost 11 years ago
Android compatible?
评论 #8159092 未加载
评论 #8158079 未加载