Hi Mark,
The UI is mostly built as a cross platform interface using OpenGL, rather
than using system-specific things like dialog boxes, however Factor has a
well used FFI interface that allows calling into C code cleanly and
easily. It also supports conditional compilation, you'll see we have
platform-specific vocabularies and words that dispatch via the type of
operating system.
One example of this is a cross-platform API to "trash" files, that on mac
goes to Trash, on windows to the recycle bin, and on linux to the
freedesktop trash spec:
http://re-factor.blogspot.com/2011/01/trashing-files-part-1-mac-os.html
http://re-factor.blogspot.com/2011/01/trashing-files-part-2-unix.html
http://re-factor.blogspot.com/2011/01/trashing-files-part-3-windows.html
We also have hooks for implementing logic on different CPU types, an
example using the RDTSC counter:
http://re-factor.blogspot.com/2010/11/estimating-cpu-speed.html
I'm sorry we don't yet have a cross-platform open-file-dialog and
save-file-dialog words, but it should be pretty easy to write and I made an
issue to track it:
https://github.com/slavapestov/factor/issues/1249
Although I'm not sure when we'll have it finished and maybe you want to
contribute the Windows version if thats the platform you use?
http://msdn.microsoft.com/en-us/library/bb776913(v=vs.85).aspx
We should probably make a UI test window that shows examples of all the
controls, that might exist but I'm not aware of it. Here's some code for
just opening a window and looking at a few gadgets:
vertical <track>
"This is a label" <label> f track-add
"This is a button" [ drop ] <border-button> f track-add
f "This is a checkbox" <checkbox> f track-add
"resource:extra/otug-talk/bi.tiff" <image-name> <icon> f track-add
T{ world-attributes
{ title "Test dialog" }
{ pref-dim { 300 250 } }
} open-window
On Mon, Dec 15, 2014 at 9:03 AM, Mark Green <m...@antelope.nildram.co.uk>
wrote:
>
> Thanks very much for your help and for the explanation. The confusion I
> had wasn't with how to define a tuple but with how to integrate the code to
> do that with your code - I'm only just getting the hang of combining
> results using bi/tri/cleave and I couldn't figure out how to apply anything
> like that when dealing with the "scan" words that are used incrementally
> and are stateful so they can only be called once. When I'm done with work
> I'm probably going to reverse engineer the code you wrote which I see seems
> to have added the tuples via using an association list?? I'm not quite
> sure.
>
> I'm also getting a bit worried about the UI aspect.. I notice there are
> some UI words which seem to be undocumented like <checkbox> but I wonder if
> there is a way to display standard message windows or in particular a file
> chooser. I know you mentioned that there is one under Cocoa but I haven't
> found one under windows or a word that works on either platform (does
> Factor have platform conditional compilation?)
>
> Mark
>
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
>
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk