currently working on this repo https://github.com/gabrielcsapo/toga-cocoa. I am falling into what else to add mode, any suggestions would be great.
--
You received this message because you are subscribed to the Google Groups "Beeware Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beeware-develop...@googlegroups.com.
To post to this group, send email to beeware-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/beeware-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/beeware-developers/c242bb88-9bb8-4baf-ba0b-5101f24dec98%40googlegroups.com.
I've just taken a look at your branch. You've done a lot of work here, much of it great - but there's a few missteps IMHO, too. Here's my initial comments:* The new examples directory is great; if nothing else, it's a good starting point for the gallery of widgets.* I don't know if it's intentional or accidental, but you've completely restructured the repository, dropping all the top level LICENSE, setup.py, etc. This makes a direct diff more difficult than it should be.
* You appear to have duplicated the contents of rubicon.objc, rather than just having that library in your PYTHONPATH - again, it makes a diff much harder than it should be
* In terms of naming style: Python convention is set_method_with_underscore(), not setCamelCase(). This is particularly noticeable in you changes to on the Button widget.
* On the subject of the button widget; it looks like you've done a feature-for-feature mapping of the capabilities of the Cocoa button widget - in particular, the fact that there is only one "button", which a bunch of modes on it (toggle, radio, momentary press, etc). That's not the approach I want to take with Toga. Instead, I want to have a bunch of independent widgets which represents the set of functionality that makes sense in a broader context, and is available across multiple platforms. In many cases, this will mean a Cocoa widget that is a very simple subclass of a base button that flicks an flag on the impl - but the point is to provide a consistent cross-platform API. The roadmap contains an initial survey of the widgets I think need to exist, with proposed names:I'm certainly up for discussion about the content of this roadmap, but I hope the intention of that document is clear.
* "SplitContainer" was a deliberate choice of name over "SplitView" - I'm trying to make a clear distinction between Views as something that displays data, and Containers, and something that holds other views.
* Calls to get_NSString() (e.g., in app.py) shouldn't be required if you're using Rubicon; the conversion of text objects (unicode on Py2, str on Py3) to NSString should be automatic. I suspect part of the problem may be that you've dropped the unicode_literals __future__ import; are you running on Python 2 or Python 3?
As an aside; over the weekend, I've been tinkering with CSS-based layout over the weekend (as inspired by React Native); my initial experiments suggest to me that it might be a lot more compelling (and easier to maintain) that constraint-based layout. The reason I mention this is that it affects the examples directory fairly significantly; it also has an impact on widget implementations (nothing major, but some notable changes). I'm hoping to push an exploratory branch later this afternoon (my time).
Yours,Russ Magee %-)
On Sun, Mar 29, 2015 at 3:47 AM, Gabriel Csapo <gabe...@gmail.com> wrote:
currently working on this repo https://github.com/gabrielcsapo/toga-cocoa. I am falling into what else to add mode, any suggestions would be great.
--
You received this message because you are subscribed to the Google Groups "Beeware Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beeware-developers+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to beeware-developers+unsub...@googlegroups.com.
To post to this group, send email to beeware-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/beeware-developers.
Hey Russell,
On Saturday, March 28, 2015 at 10:49:13 PM UTC-4, Russell Keith-Magee wrote:I've just taken a look at your branch. You've done a lot of work here, much of it great - but there's a few missteps IMHO, too. Here's my initial comments:* The new examples directory is great; if nothing else, it's a good starting point for the gallery of widgets.* I don't know if it's intentional or accidental, but you've completely restructured the repository, dropping all the top level LICENSE, setup.py, etc. This makes a direct diff more difficult than it should be.I apologize for the directory mixup. I have been editing the installed version of toga_cooca located in site-packages.I am refactoring to fix the problems that have come because of that.* You appear to have duplicated the contents of rubicon.objc, rather than just having that library in your PYTHONPATH - again, it makes a diff much harder than it should bepart of the problem with me editing the installed version
* In terms of naming style: Python convention is set_method_with_underscore(), not setCamelCase(). This is particularly noticeable in you changes to on the Button widget.will adhere to python convention, I use multiple languages throughout the day, semantics with dealing such things.
* On the subject of the button widget; it looks like you've done a feature-for-feature mapping of the capabilities of the Cocoa button widget - in particular, the fact that there is only one "button", which a bunch of modes on it (toggle, radio, momentary press, etc). That's not the approach I want to take with Toga. Instead, I want to have a bunch of independent widgets which represents the set of functionality that makes sense in a broader context, and is available across multiple platforms. In many cases, this will mean a Cocoa widget that is a very simple subclass of a base button that flicks an flag on the impl - but the point is to provide a consistent cross-platform API. The roadmap contains an initial survey of the widgets I think need to exist, with proposed names:I'm certainly up for discussion about the content of this roadmap, but I hope the intention of that document is clear.Could there be a breakdown of specific types of elements, for example you say switch which is a subclass of button. Right now in the button class I have
- basic_button
- momentary_button
- toggle_button
- switch_button
- radio_button
- momentary_change_button
- on_off_button
- momentary_pushin_button
You mention the roadmap which includes multiple UI elements structured by input, view and containers but I see a discrepancy in the way you structured this.You mention table in the input section with the line "Table: A scrollable display of columns of data", but then in the view section you say "views are mechanisms for displaying rich content, usually in a readonly manner", in this case a table is a view and also an input.
* "SplitContainer" was a deliberate choice of name over "SplitView" - I'm trying to make a clear distinction between Views as something that displays data, and Containers, and something that holds other views.I saw this as a semantic change, since the actual element in cocoa is called NSSplitView, also in WPF land it is referred to as SplitView as well (https://channel9.msdn.com/Series/Developers-Guide-to-Windows-10-Preview/05)*SplitView Control*. I now understand that change to make that clear on your side.* Calls to get_NSString() (e.g., in app.py) shouldn't be required if you're using Rubicon; the conversion of text objects (unicode on Py2, str on Py3) to NSString should be automatic. I suspect part of the problem may be that you've dropped the unicode_literals __future__ import; are you running on Python 2 or Python 3?This was the problem I brought up in an early post with get_NSString() not working when using the Rubicon version, but when using the objc.py file, which comes with the install of toga_cocoa it works perfectly.
As an aside; over the weekend, I've been tinkering with CSS-based layout over the weekend (as inspired by React Native); my initial experiments suggest to me that it might be a lot more compelling (and easier to maintain) that constraint-based layout. The reason I mention this is that it affects the examples directory fairly significantly; it also has an impact on widget implementations (nothing major, but some notable changes). I'm hoping to push an exploratory branch later this afternoon (my time).I for one thing that this should be choice, in windows you have a choice to choose between multiple layout managers, and I think that is really useful.
Constrained based layouts are flexible and easy to read, looking at the CSS-based layouts that you are talking about, there is a lot of code to explain the same output. For example if someone wanted to have a 'btn-block' like in bootstrap world, that is easy with a constrained layout;container = toga.Container()basic_button = toga.Button("Basic Button")container.add(basic_button)container.constrain(basic_button.RIGHT == container.RIGHT - 5)container.constrain(basic_button.LEFT == container.LEFT + 5)To accomplish the same with CSS-based layoutcontainer = toga.Container()container container.style(flexDirection='row', margin=5)basic_button = toga.Button("Basic Button")container.add(basic_button)basic_button.style(width:100%)
I am unsure if width is just a pixel based ratio, or it has the ability to be a percentage. I also don't want you to think I am against the idea, if it was just as easy to markup native applications as web applications, I would be all for it, but the styling is not done on the elements themselves, it is done by a CSS file which then is passed into the browser and renders the elements into their proper proportions and other attributes (color, text). If there was someone to emulate that experience, it might be an interesting proposition.
On Mon, Mar 30, 2015 at 12:19 AM, Gabriel Csapo <gabe...@gmail.com> wrote:Hey Russell,
On Saturday, March 28, 2015 at 10:49:13 PM UTC-4, Russell Keith-Magee wrote:I've just taken a look at your branch. You've done a lot of work here, much of it great - but there's a few missteps IMHO, too. Here's my initial comments:* The new examples directory is great; if nothing else, it's a good starting point for the gallery of widgets.* I don't know if it's intentional or accidental, but you've completely restructured the repository, dropping all the top level LICENSE, setup.py, etc. This makes a direct diff more difficult than it should be.I apologize for the directory mixup. I have been editing the installed version of toga_cooca located in site-packages.I am refactoring to fix the problems that have come because of that.* You appear to have duplicated the contents of rubicon.objc, rather than just having that library in your PYTHONPATH - again, it makes a diff much harder than it should bepart of the problem with me editing the installed versionDo you know about pip install -e? Run this in the root of a Python source directory (i.e., a directory with setup.py), and it will "install" your source directory into site_packages, but allow you to keep editing the source exactly where it is checked out.
* In terms of naming style: Python convention is set_method_with_underscore(), not setCamelCase(). This is particularly noticeable in you changes to on the Button widget.will adhere to python convention, I use multiple languages throughout the day, semantics with dealing such things.* On the subject of the button widget; it looks like you've done a feature-for-feature mapping of the capabilities of the Cocoa button widget - in particular, the fact that there is only one "button", which a bunch of modes on it (toggle, radio, momentary press, etc). That's not the approach I want to take with Toga. Instead, I want to have a bunch of independent widgets which represents the set of functionality that makes sense in a broader context, and is available across multiple platforms. In many cases, this will mean a Cocoa widget that is a very simple subclass of a base button that flicks an flag on the impl - but the point is to provide a consistent cross-platform API. The roadmap contains an initial survey of the widgets I think need to exist, with proposed names:I'm certainly up for discussion about the content of this roadmap, but I hope the intention of that document is clear.Could there be a breakdown of specific types of elements, for example you say switch which is a subclass of button. Right now in the button class I have
- basic_button
- momentary_button
- toggle_button
- switch_button
- radio_button
- momentary_change_button
- on_off_button
- momentary_pushin_button
Well, there *is* a partial (and admittedly incomplete) breakdown already - there's Button and Switch for example.The key distinction I'm trying to make is that I'm not just trying to enumerate "widgets that are available on an underlying platform", but "widgets for which there is a distinct UI/UX purpose".I will admit that the roadmap is incomplete - the omission of radio buttons, for example, is a clear oversight on my part. So why does a RadioSelection widget deserve to exist? And, to be clear - it's a RadioSelection, not a standalone RadioButton, because there's no reason to put a single RadioButton on a GUI without a label, and at least one other RadioButton. When do you use RadioSelection and when do you use Selection? You use RadioSelection when the number of options is small and fixed. You use Selection when the list of options is long, or can vary depending on other application context. Reflecting this distinction, there's probably a better name than RadioSelection and Selection, too.As supporting evidence, a Radio button widget is available on OSX, GTK+ and Windows. This existence proof is a demonstration that multiple UI teams have made the UI distinction, but it's not, IMHO, prima facie proof that a Toga widget is required.As a counterpoint, I *don't* see a fundamental reason why there needs to be a Switch, OnOff and Checkbox widget. A toga.Switch is something you use to toggle something that has an on/off option state. You'll note that on the roadmap, Switch is listed as an NSButton with checkbox style on OSX, but an UISwitch on OS/X - that's because the interaction metaphors on the two platforms are different. The only times I've seen a true "on/off" Switch on OS/X has been for showy reasons, where it is (arguably) inconsistent UI/UX.So - the fundamental question to be asked is "What is the UX reason for having multiple alternatives?" What's the UX difference between a checkbox and a switch? As a minimum barrier to entry, you need to be able to put in the documentation a UX explanation for when you use widget A instead of B. If you can make that argument for any of your other button types, I'll happily accept them.
You mention the roadmap which includes multiple UI elements structured by input, view and containers but I see a discrepancy in the way you structured this.You mention table in the input section with the line "Table: A scrollable display of columns of data", but then in the view section you say "views are mechanisms for displaying rich content, usually in a readonly manner", in this case a table is a view and also an input.That's a fair point. In retrospect, I'd agree that Tree and Table are probably closer to View than Input. If there's an Input aspect to those widgets, it is at the level of an individual row or cell in the view. Tree and Table should probably be renamed to TreeView and TableView.
Yours,Russ Magee %-)
On Sunday, March 29, 2015 at 11:20:39 PM UTC-4, Russell Keith-Magee wrote:On Mon, Mar 30, 2015 at 12:19 AM, Gabriel Csapo <gabe...@gmail.com> wrote:Hey Russell,
On Saturday, March 28, 2015 at 10:49:13 PM UTC-4, Russell Keith-Magee wrote:* On the subject of the button widget; it looks like you've done a feature-for-feature mapping of the capabilities of the Cocoa button widget - in particular, the fact that there is only one "button", which a bunch of modes on it (toggle, radio, momentary press, etc). That's not the approach I want to take with Toga. Instead, I want to have a bunch of independent widgets which represents the set of functionality that makes sense in a broader context, and is available across multiple platforms. In many cases, this will mean a Cocoa widget that is a very simple subclass of a base button that flicks an flag on the impl - but the point is to provide a consistent cross-platform API. The roadmap contains an initial survey of the widgets I think need to exist, with proposed names:I'm certainly up for discussion about the content of this roadmap, but I hope the intention of that document is clear.Could there be a breakdown of specific types of elements, for example you say switch which is a subclass of button. Right now in the button class I have
- basic_button
- momentary_button
- toggle_button
- switch_button
- radio_button
- momentary_change_button
- on_off_button
- momentary_pushin_button
Well, there *is* a partial (and admittedly incomplete) breakdown already - there's Button and Switch for example.The key distinction I'm trying to make is that I'm not just trying to enumerate "widgets that are available on an underlying platform", but "widgets for which there is a distinct UI/UX purpose".I will admit that the roadmap is incomplete - the omission of radio buttons, for example, is a clear oversight on my part. So why does a RadioSelection widget deserve to exist? And, to be clear - it's a RadioSelection, not a standalone RadioButton, because there's no reason to put a single RadioButton on a GUI without a label, and at least one other RadioButton. When do you use RadioSelection and when do you use Selection? You use RadioSelection when the number of options is small and fixed. You use Selection when the list of options is long, or can vary depending on other application context. Reflecting this distinction, there's probably a better name than RadioSelection and Selection, too.As supporting evidence, a Radio button widget is available on OSX, GTK+ and Windows. This existence proof is a demonstration that multiple UI teams have made the UI distinction, but it's not, IMHO, prima facie proof that a Toga widget is required.As a counterpoint, I *don't* see a fundamental reason why there needs to be a Switch, OnOff and Checkbox widget. A toga.Switch is something you use to toggle something that has an on/off option state. You'll note that on the roadmap, Switch is listed as an NSButton with checkbox style on OSX, but an UISwitch on OS/X - that's because the interaction metaphors on the two platforms are different. The only times I've seen a true "on/off" Switch on OS/X has been for showy reasons, where it is (arguably) inconsistent UI/UX.So - the fundamental question to be asked is "What is the UX reason for having multiple alternatives?" What's the UX difference between a checkbox and a switch? As a minimum barrier to entry, you need to be able to put in the documentation a UX explanation for when you use widget A instead of B. If you can make that argument for any of your other button types, I'll happily accept them.I think this is a valid argument, but if you are looking for a native GUI, different OS's have different ways of visualizing that GUI. A switch is a basic GUI element for OSX and iOS, for windows a I don't know if I have ever seen a switch, but instead have seen a checkbox to visualize that. I don't think it is a a right direction to go in if the main argument is to omit GUI elements because they don't exist in all platforms.
I understand your reasoning and this follows the same semantics that the Java GUI or Tkinter or GTK+ use, but when I read the headline of the library, my idea of native GUI just means an abstraction, not a inconvenience.The only reason I see this as being frustrating is debugging components on different operating systems. When I look at a tableview on OSX, I have the ability to go look up exactly what a tableview can do on that platform and design my application to understand those constraints by looking at native documentation and not having to abstract that to a concept where I have to do more work.This isn't just checkbox and switch widgets. OSX has different ways of representing the share menu, or accessing system level events, if your philosophy is build once deploy everywhere that was not explained when my initial thought of toga. I read "A Python native, OS native GUI toolkit. Part of the BeeWare suite."to that I thought being able to have a consistent programming style between platforms.I am sorry if this is wasting your time, I am just trying to understand the reasoning.
--
You received this message because you are subscribed to the Google Groups "Beeware Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beeware-develop...@googlegroups.com.
To post to this group, send email to beeware-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/beeware-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/beeware-developers/CAJxq84-P9z43qD7FkKfaLhTjY7yunQM0aQWad6oewhxwj_kb_Q%40mail.gmail.com.
I'm just throwing this out there because it's why I never really contributed and this seems to be the same issue I had. Why not define some abstract base classes that we inherit from in concordance with the roadmap and then disallow new controls without first defining an abstract base class for them?
It seems that this would avoid issues like this: as a backend maintainer/contributor, I know exactly what is expected because I am being told what the interface *must* look like.
Not sure if this is off topic for this thread, but I'm seeing a symptom of a potentially larger problem, so I figured I'd ask.
--
You received this message because you are subscribed to the Google Groups "Beeware Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beeware-develop...@googlegroups.com.
To post to this group, send email to beeware-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/beeware-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/beeware-developers/CAJxq848gvAHqHGRqfzkrPo8XQU5btp%3DcLkzqt66FVQvH9rsepQ%40mail.gmail.com.
I was specifically talking about the abc module and the public interface. I know code isn't shared, but I for one consider a method whose body is pass to be a "todo" item and, if nothing else, it forces me to have them. At the moment, in order to be a backend maintainer, one ahs to be involved in some sort of converging interface process. Or at least, that's what it looks like from the outside.
But maybe I'm in a minority for wanting to design this way. And my primary language is C++, which probably says a lot.