On Mon, 29 Oct 2007 21:19:39 +1300
"Graeme Prentice" <[EMAIL PROTECTED]> wrote:
> What GUI interface capability does Factor have.
Hi, I was actually just playing with all of this during the last week.
Currently I'd say the documentation is very "math guy friendly" being that it
tells you what everything is, but doesn't give much hand holding or example
code to follow. Otherwise it is fairly capable already and you can easily
extend it based on how it is designed.
Your best friend is to take a look at the various tests found in extra to see
how things are structured, then use grep to see where particular words are used
and take a look at those examples.
One thing you won't find is a large extensive library of pre-packaged widgets
like in wxWidgets. It has the majority of basic ones, and a very good editor
component already, but not Tree widgets, readily available pop-up menus, etc.
What you will find is that compared to wxWidgets the amount of code you write
to get these components working is very small and fairly readable once you
understand factor. It is also fairly trivial to build your own components, and
with Cairo bindings and OpenGL bindings what you make looks high quality on
most platforms.
When learning the GUI components, I'd also say to watch for inconsistencies.
For example, you build arrays via quotations normally like this:
[ 1 , 2 , 3 , 4 , ] { } make
However, in most of the GUI make words it's done like this:
[ "hi" <label> gadget, "there" <label> gadget, ] make-pile
But in frames it's like this:
[ "hi" <label> @top frame, "there" <label> @center frame, ] make-frame
And so on. The gist is when you make-blah you (generally) use blah, to build
it.
> It seems that it's not like e.g. wxWidgets where the same top level code
> produces a more or less equivalent result in terms of listboxes, checkboxes,
> treeviews etc. regardless of which platform you compile for - the same top
> level code still works and geta translated to a native look and feel by thw
> WxWidgets infrastructure.
If you are looking for native look-and-feel on all platforms (which is from my
experience damn hard and not really worth it) then you should check out the
cocoa bindings on OSX. This could be a model for a similar library, but you'd
have to put in the work for this.
The cool thing is that the Factor Alien library is pretty good for binding to C
code, so it might be a decent project for someone ambitious.
> How does factor work? Do you have to redo all the user-level GUI generating
> code for every platform you want it to run on?
> i.e. to create a GUI app for Windows, I have to learn some Window API stuff,
> or maybe try and bind to WTL and for Linux I have to learn X11 - is that
> right?
Factors GUI is implemented using a small amount of code for each platform to
handle things like window creation, resize, mouse, keyboard, etc. and then the
majority of the UI is built with OpenGL. The Factor OpenGL bindings are very
good, so this means you get the same UI on all platforms and it's fast and
stable (mostly). The down side is it doesn't look like the native widgets.
This fits a design purpose of Factor which is to make games. Most games
usually don't care about the native look and are shooting for style more than
anything.
I'll let Slava and friends correct me since I'm probably wrong on several
fronts.
--
Zed A. Shaw
- Hate: http://savingtheinternetwithhate.com/
- Good: http://www.zedshaw.com/
- Evil: http://yearofevil.com/
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk