Earlier quoted context omitted.
It's using native Cocoa controls, so I'm not sure why you don't think it looks native.
Because the layout that's presented is not native. Actual mac apps don't have tabs and toolbars pushed together like that, and the margins are different. wxWidgets can use the platform native controls, but the apps rarely look native because the layouts and behaviors are non-native. Mac/GNOME/Windows all have different ideal metrics for spacings, control placement and labeling (OK/Cancel vs Cancel/"Do Thing") -- bein…
Toga: A Python native, OS native GUI toolkit
31–40 of 72 posts
Re: Toga: A Python native, OS native GUI toolkit
#32left_container = toga.OptionContainer() AttributeError: 'module' object has no attribute 'OptionContainer' Frustrating when things that are supposed to work out of the box, don't. Initial search yields no help.
Edit: In fact, OptionContainer is just 15 days old, so I think you've got an old version: https://github.com/pybee/toga/commit/262efbfc00fae0a96e09666...
Re: Toga: A Python native, OS native GUI toolkit
#33left_container = toga.OptionContainer() AttributeError: 'module' object has no attribute 'OptionContainer' Frustrating when things that are supposed to work out of the box, don't. Initial search yields no help.
What version of toga are you running? I'm on Ubuntu with Python 2.7.6, toga v 0.1.0 and cassowary 0.5 and your oneliner works fine. Edit: In fact, OptionContainer is just 15 days old, so I think you've got an old version: https://github.com/pybee/toga/commit/262efbfc00fae0a96e09666...
Re: Toga: A Python native, OS native GUI toolkit
#34 container.constrain(button.TOP == container.TOP + 50)
Python doesn't let you pass expressions! Why isn't that just getting evaluated to true or false? Is this not vanilla Python? Is there a pre-processor?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.
Very interesting and clever use of operator overloading.
[1] https://github.com/pybee/toga/blob/master/toga/constraint.py
Re: Toga: A Python native, OS native GUI toolkit
#35The Mac screenshot I see on the home page looks about as non-native as the average Qt app.
Re: Toga: A Python native, OS native GUI toolkit
#36I was really confused when I read "the constrain() call takes expressions that define the relationships you want to impose" (emphasis mine) and saw this code: container.constrain(button.TOP == container.TOP + 50) Python doesn't let you pass expressions! Why isn't that just getting evaluated to true or false? Is this not vanilla Python? Is there a pre-processor? I dove into the code and found the answer here[1]. butto…
Re: Toga: A Python native, OS native GUI toolkit
#37I was really confused when I read "the constrain() call takes expressions that define the relationships you want to impose" (emphasis mine) and saw this code: container.constrain(button.TOP == container.TOP + 50) Python doesn't let you pass expressions! Why isn't that just getting evaluated to true or false? Is this not vanilla Python? Is there a pre-processor? I dove into the code and found the answer here[1]. butto…
Re: Toga: A Python native, OS native GUI toolkit
#38Earlier quoted context omitted.
Because the layout that's presented is not native. Actual mac apps don't have tabs and toolbars pushed together like that, and the margins are different. wxWidgets can use the platform native controls, but the apps rarely look native because the layouts and behaviors are non-native. Mac/GNOME/Windows all have different ideal metrics for spacings, control placement and labeling (OK/Cancel vs Cancel/"Do Thing") -- bein…
Fair point. The spacing and margins are totally wrong, for sure. But that's just spacing & margins, and I assume that's easily adjusted (and they should do that, so their demo doesn't look ugly). But nonetheless, the widgets are native Cocoa widgets, so they not only look native, they feel and behave native, something you can't say about Qt (at least not to the same degree — although I develop with Qt, love Qt, and h…
Under the hood, it's 100% native widgets (i.e., on OSX, the code is actually instantiating an NSButton, adding it to an NSView, set as content on an NSWindow; on Ubuntu, it uses Gtk.Button etc), so the look and feel of the widgets themselves are exactly as the platform dictates.
Re: Toga: A Python native, OS native GUI toolkit
#39Earlier quoted context omitted.
That's a matter of design, not an observation based on technical merits.
Maybe I'm missing something, but isn't the main 'hook' for this library that it looks native? Looks like it uses GTK+, so from a technical standpoint it would be as "native" as Qt.
Re: Toga: A Python native, OS native GUI toolkit
#40This looks promising. It would be better if the documentation was a bit more exhaustive[0] [0] http://toga.readthedocs.org/en/latest/internals/platforms/de... .