HNHacker News
TopNewBestAskShowJobs

andlabs

63 karma · joined June 6, 2014

submissionscomments
andlabs··on Native GUI library for Go
What random formatting do you mean, other than what go fmt would produce? What unidiomatic naming conventions? I thought I removed all the dead code... which ones do you still see? What suggestions can you make about organization?
andlabs··on Native GUI library for Go
go-qml has already stirred up enough interest for that same guy to run a program-making contest at the recent GopherCon so I guess it's safe to say your hopes are reasonable =P
andlabs··on Native GUI library for Go
I have a very good feeling telling that to byuu isn't going to end well...

That being said, byuu is absolutely correct. It's one thing to make a program look like all the other programs on the target platform, but it's something else entirely to make it feel like one as well. You'll need to compromise quite a bit, as even when you go into raw event-handling no two systems are alike. You can see olddocs/areaplan.md in my repo as an example of where this gets especially hair-pulling, or all the places in the documentation where I mark some subtlety as implementation-defined or system-defined.

Not even the big packages are immune. Look at Qt's QFormLayout type, which is a dedicated layout for aligning labels properly on each platform. (I'm going to have a similar thing eventually; that's why my docs presently have a TODO on vertical alignment with Label.)

And yes, human interface guidelines can differ in very subtle ways. As an example, take multiple-selection listboxes. There are two ways you can implement this: as a normal listbox that you can select multiple items of, or as a list of items with checkboxes that you check to mark as selected.

Microsoft's guidelines (http://msdn.microsoft.com/en-us/library/windows/desktop/dn74...) say (emphasis preserved) > Given this clear indication of multiple selection, you > might assume that check box lists are preferable to > standard multiple-selection lists. In practice, few tasks > require multiple selection or use it heavily; using a > check box list in such cases draws too much attention to > selection. Consequently, standard multiple-selection > lists are far more common.

GNOME's guidelines (https://developer.gnome.org/hig-book/stable/controls-lists.h...) say > Consider using a check box list for multiple-selection > lists, as these make it more obvious that multiple > selection is possible:

And Apple's guidelines (https://developer.apple.com/library/mac/documentation/UserEx...) don't say anything too clearly, but DO say that - scrolling lists are selected traditionally (not checkboxed) - but a menu-style list should use check marks instead

So there's that.

andlabs··on Native GUI library for Go
For the record, and this applies to all comments above and below: by "platform-native" for this package, I do no custom drawing; everything is deferred out to the underlying system APIs. So this actually uses Cocoa on Mac OS X (you can see the .m files as well) and the Windows API on Windows (which is part of the reason I didn't go with just having Qt bindings).
andlabs··on Native GUI library for Go
Partially true; I was driven to write this because I wasn't particularly satisfied with what already existed for various differing reasons. The current feature set and my own short-term plans are based around the GUI projects that I intend to write first (specifically a music authoring program).

As for screenshots, I suppose I could upload a screenshot of the test program, but I'm not sure how much that would accomplish. I think a basic tutorial with screenshots at each step would probably be more useful, as it shows how the package works...

andlabs··on Native GUI library for Go
While I do have Wayland in mind, that's specifically for what I can do with the GTK+ backend when running against GTK+'s limits. For this particular feature, there's a different rationale, but I can't remember what it was right now. That being said, I may add such a thing in the future (there's something in futureplans.md about centering the window right now, so...).

And yes, this is still rather incomplete (I'm surprised it's getting so much attention this early!); please feel free to make suggestions!

andlabs··on Native GUI library for Go
FWIW this is specifically why Objective-C has been able to get by without generics for a while. You don't get solid type-checking like you do with generics in other languages (except C++), but that has never really been an issue because the above statement works even with [...] statements (sure, the compiler will warn you, but).

The only real issue is that the things you shove into Objective-C containers must themselves be Objective-C types, which means using NSNumber and NSValue everywhere for raw C types. The new Objective-C @literal and @(expression) syntax, however, should make such code cleaner in the future...

andlabs··on Native GUI library for Go
I just replaced it with a detailed placeholder for now. (Replacing it was something I had stuck in the back of my mind for a while.)
← PreviousPage 2 of 2