On Tuesday, June 26, 2012 11:05:01 PM UTC-4, tones111 wrote:
Thanks for getting the ball rolling on a UI library centered around the interesting concepts go provides. While I'm still trying to get up to speed on go.uik I have a couple questions on the design. Perhaps some of my confusion is due to the new terminology and trying to figure out how that maps to more traditional names.
I think the most straightforward way to approach object hierarchy would be to have types that implement the composite design pattern (
https://en.wikipedia.org/wiki/Composite_pattern). I think you've got this with Foundation mapping to "composite" and Block to "leaf", right? Any chance those names might change to something more descriptive (like Container and widget, respectively)? What's the difference between a Block and a Widget? Isn't a widget conceptually just a concrete implementation of a Block?
Foundation and Block are analogous to what are often called Container and Component. I am purposefully ignoring a lot of existing design and terminology because I am trying to do something different.
With go.uik, different Blocks are separated much more strongly than different components will be in other UI kits. And a Foundation doesn't really contain Blocks, but supports them. I felt like the metaphor invoked by Foundations and Blocks matched more closely to how I thought of the design than Container and Component/Widget. But, in the end, it's just a metaphor - you can think of it however you like.
I tried to make a simple example using the flow layout but couldn't ever get it to display properly. Would it be possible to add basic examples for each layout because it appears the interfaces to use them differ? Currently both examples use a GridEngine which seems overly complex for the type of simple applications I'd like to write to get a feel for things. The flow layout doesn't work as a layouter and I wasn't able to figure out the right magic to get a few buttons added and displayed.
Rather than Flow (which I really need to delete), try layouts.HBox() and layouts.VBox(). They're functions that set up grids in a simple and common way.
But...yes. Things are extremely rough around the edges right now. And through the middle too, to be honest. Lots of work needs to be done with robustness, completeness, and documentation.
The widget tutorial does a fair job of describing the how things work internally for the widget, but it skims over the design of how a user of the widget receives events. Any chance you might be able to elaborate on this portion of the design?
At the moment you can make a subscription that monitors all user events. You need to send a uik.Subscription to your block's .Subscribe channel. I have started to move this kind user-facing of interface from channel-based to function-based methods. That way it actually shows up in the documentaiton...
One concept I like from Qt is how the library allows connecting signals and slots together (here the output and input channels between blocks). While I _really_ don't like the lack of compile time checking in Qt I think this is an area where a go implementation could shine. Since each widget is running in its own go routine you wouldn't need to spawn a separate go routine to recieve an event just to then manipulate some other widget. I think that could clean up a lot of the current event handling boilerplate.
Some helper function that created a certain kind of subsciption, and send another message to another block when that subscription fired, would probably be pretty useful :) potential future work.
On a side note, at the moment I'm trying to focus on writing my dissertation. Once that's done and out of the way I hope to devote more time to go.uik.