GUI library

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

GUI library

Rasmus Schultz
Has anyone attempted the idea of writing a GUI library that would
compile against both Flash and JavaScript?

It should be theoretically possible ...

Of course, you would need to build from the ground up, starting with
something really simple, like a "window" class - not in the sense of a
draggable window with borders and menus and stuff, but a core component
that had functionality similar to that of a "window" in Windows ...
personally I would choose another name, to avoid ambiguity, so let's
call it a Surface, and let it provide some minimal funcionality common
to all windowed elements:

- positionable (x, y)
- sizable (w, h)
- show/hide
- nestable
- scrollable (offsetx, offsety)
- hookable mouse events (mousedown, mouseup, mousemove, click,
doubleclick, rightclick)
- focusable (optional), hookable focus events (onfocus, onblur)
- hookable keyboard events (keypress, keydown, keyup) taking focus into
account

In JavaScript/HTML, this would probably be implemented as a class
controlling a <div> element.

This component, once fully cross-browser and fully tested, could be used
as a basis for a GUI toolkit of any type - maybe something like
wxWidgets or VCL - a lot of the widget logic could be ported from an
existing, proven library.

Ext and other pure JavaScript libraries are full of errors - partially
because everyone tries to catch browser differences and inconsistent
behaviors long after they "trickle down" ... if you had a reliable
component at the core of a JavaScript GUI library (which currently none
of them do!), building real applications in JavaScript might actually be
fun, rather than torture. To build something like this, with a
consistently enforced API, Haxe is needed - JavaScript is simply not a
good language for anything of this complexity, and I think the lack of a
reliable JavaScript GUI framework is proof of this.

Just my personal opinion :-)

I am working with Ext daily, and it's a painful experience. Not only
because of Ext, which is a fairly impressive framework, but more because
of JavaScript in general. Haxe would be much better suited to provide
the strictness necessary to build a stable GUI framework.

Has anybody else had any thoughts in this direction, or am I rambling? :-)

/ Rasmus


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: GUI library

alstrup
It should be possible to roll a backend for HTML for large parts of Arctic. Have a look at ArcticView, which is the main class that builds the UI. You can either extend that with HTML stuff, or you can roll a new file from scratch and start implementing the blocks one by one. The last approach is probably better for morale, because you will quickly have something on the screen. Patches welcome ;-)

Regards,
Asger


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: GUI library

Daniel Turing
In reply to this post by Rasmus Schultz
On Tue, 2008-11-11 at 18:03 -0500, Rasmus Schultz wrote:
> - positionable (x, y)
> - sizable (w, h)
> - show/hide
> - nestable
> - scrollable (offsetx, offsety)
> - hookable mouse events (mousedown, mouseup, mousemove, click,
> doubleclick, rightclick)
> - focusable (optional), hookable focus events (onfocus, onblur)
> - hookable keyboard events (keypress, keydown, keyup) taking focus

> Has anybody else had any thoughts in this direction, or am I
> rambling? :-)

my thoughts in the direction are
http://xinf.org/xinf/ony/Element.hx
and
http://xinf.org/xinf/ul/Component.hx
.

questions welcome ;)

-dan



--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: GUI library

jlm@justinfront.net
flex and Xaml are fairly new approaches to these issues I am not sure  
the opensource equivalent but it is worth considering the naming  
structures etc.. in relation?

On 12 Nov 2008, at 01:14, Daniel Turing wrote:

> On Tue, 2008-11-11 at 18:03 -0500, Rasmus Schultz wrote:
>> - positionable (x, y)
>> - sizable (w, h)
>> - show/hide
>> - nestable
>> - scrollable (offsetx, offsety)
>> - hookable mouse events (mousedown, mouseup, mousemove, click,
>> doubleclick, rightclick)
>> - focusable (optional), hookable focus events (onfocus, onblur)
>> - hookable keyboard events (keypress, keydown, keyup) taking focus
>
>> Has anybody else had any thoughts in this direction, or am I
>> rambling? :-)
>
> my thoughts in the direction are
> http://xinf.org/xinf/ony/Element.hx
> and
> http://xinf.org/xinf/ul/Component.hx
> .
>
> questions welcome ;)
>
> -dan
>
>
>
> --
> haXe - an open source web programming language
> http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: GUI library

Cesar Lesc
A reference could be the Echo Framework
(http://echo.nextapp.com/site/echo3), they have a programming model
similar to java swing in javascript, and AsWing
(http://www.aswing.org/) also follows this pattern, may be borrowing
ideas of both could be a start point.

C├ęsar

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: GUI library

Gamehaxe
In reply to this post by Rasmus Schultz
Another possiblity would be to port neash to javascript too.
This may be a bit of a stretch - I'm not sure how similar
the apis would be.  The good thing would be that you could
use your existing flash code (or anyone elses) to port to
js/flash/neko/cpp.  You would have to be reasonably keen to
take this path though.

Hugh

> Has anyone attempted the idea of writing a GUI library that would  
> compile against both Flash and JavaScript?
>
> It should be theoretically possible ...
>
> Of course, you would need to build from the ground up, starting with  
> something really simple, like a "window" class - not in the sense of a  
> draggable window with borders and menus and stuff, but a core component  
> that had functionality similar to that of a "window" in Windows ...  
> personally I would choose another name, to avoid ambiguity, so let's  
> call it a Surface, and let it provide some minimal funcionality common  
> to all windowed elements:
>
> - positionable (x, y)
> - sizable (w, h)
> - show/hide
> - nestable
> - scrollable (offsetx, offsety)
> - hookable mouse events (mousedown, mouseup, mousemove, click,  
> doubleclick, rightclick)
> - focusable (optional), hookable focus events (onfocus, onblur)
> - hookable keyboard events (keypress, keydown, keyup) taking focus into  
> account
>
> In JavaScript/HTML, this would probably be implemented as a class  
> controlling a <div> element.
>
> This component, once fully cross-browser and fully tested, could be used  
> as a basis for a GUI toolkit of any type - maybe something like  
> wxWidgets or VCL - a lot of the widget logic could be ported from an  
> existing, proven library.
>
> Ext and other pure JavaScript libraries are full of errors - partially  
> because everyone tries to catch browser differences and inconsistent  
> behaviors long after they "trickle down" ... if you had a reliable  
> component at the core of a JavaScript GUI library (which currently none  
> of them do!), building real applications in JavaScript might actually be  
> fun, rather than torture. To build something like this, with a  
> consistently enforced API, Haxe is needed - JavaScript is simply not a  
> good language for anything of this complexity, and I think the lack of a  
> reliable JavaScript GUI framework is proof of this.
>
> Just my personal opinion :-)
>
> I am working with Ext daily, and it's a painful experience. Not only  
> because of Ext, which is a fairly impressive framework, but more because  
> of JavaScript in general. Haxe would be much better suited to provide  
> the strictness necessary to build a stable GUI framework.
>
> Has anybody else had any thoughts in this direction, or am I rambling?  
> :-)
>
> / Rasmus
>
>



--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: GUI library

Niel Drummond-3
Hugh Sanderson wrote:

Hi Hugh,

> Another possiblity would be to port neash to javascript too.
> This may be a bit of a stretch - I'm not sure how similar
> the apis would be.  The good thing would be that you could
> use your existing flash code (or anyone elses) to port to
> js/flash/neko/cpp.  You would have to be reasonably keen to
> take this path though.

I have embarked on this route (some progress is on
http://cyanescent.co.uk/canvasdemo ), though as you say there are some
unsimilarities between the APIs. I've had to modify small parts of
Neash, and I am wondering whether you are keeping track of your code in
a repository ? It would help me keep up to date with your changes for
cpp, and suggest some patches if they are useful...

regards,

- Niel

>
> Hugh
>
>> Has anyone attempted the idea of writing a GUI library that would
>> compile against both Flash and JavaScript?
>>
>> It should be theoretically possible ...
>>
>> Of course, you would need to build from the ground up, starting with
>> something really simple, like a "window" class - not in the sense of
>> a draggable window with borders and menus and stuff, but a core
>> component that had functionality similar to that of a "window" in
>> Windows ... personally I would choose another name, to avoid
>> ambiguity, so let's call it a Surface, and let it provide some
>> minimal funcionality common to all windowed elements:
>>
>> - positionable (x, y)
>> - sizable (w, h)
>> - show/hide
>> - nestable
>> - scrollable (offsetx, offsety)
>> - hookable mouse events (mousedown, mouseup, mousemove, click,
>> doubleclick, rightclick)
>> - focusable (optional), hookable focus events (onfocus, onblur)
>> - hookable keyboard events (keypress, keydown, keyup) taking focus
>> into account
>>
>> In JavaScript/HTML, this would probably be implemented as a class
>> controlling a <div> element.
>>
>> This component, once fully cross-browser and fully tested, could be
>> used as a basis for a GUI toolkit of any type - maybe something like
>> wxWidgets or VCL - a lot of the widget logic could be ported from an
>> existing, proven library.
>>
>> Ext and other pure JavaScript libraries are full of errors -
>> partially because everyone tries to catch browser differences and
>> inconsistent behaviors long after they "trickle down" ... if you had
>> a reliable component at the core of a JavaScript GUI library (which
>> currently none of them do!), building real applications in JavaScript
>> might actually be fun, rather than torture. To build something like
>> this, with a consistently enforced API, Haxe is needed - JavaScript
>> is simply not a good language for anything of this complexity, and I
>> think the lack of a reliable JavaScript GUI framework is proof of this.
>>
>> Just my personal opinion :-)
>>
>> I am working with Ext daily, and it's a painful experience. Not only
>> because of Ext, which is a fairly impressive framework, but more
>> because of JavaScript in general. Haxe would be much better suited to
>> provide the strictness necessary to build a stable GUI framework.
>>
>> Has anybody else had any thoughts in this direction, or am I
>> rambling? :-)
>>
>> / Rasmus
>>
>>
>
>
>


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: GUI library

Gamehaxe
Excellent idea.  That demo is already looking pretty cool! The code is at:

http://code.google.com/p/neash/

Sign up with google code and send me your ID and I
will add you to project.

Hugh



> Hugh Sanderson wrote:
>
> Hi Hugh,
>
>> Another possiblity would be to port neash to javascript too.
>> This may be a bit of a stretch - I'm not sure how similar
>> the apis would be.  The good thing would be that you could
>> use your existing flash code (or anyone elses) to port to
>> js/flash/neko/cpp.  You would have to be reasonably keen to
>> take this path though.
>
> I have embarked on this route (some progress is on  
> http://cyanescent.co.uk/canvasdemo ), though as you say there are some  
> unsimilarities between the APIs. I've had to modify small parts of  
> Neash, and I am wondering whether you are keeping track of your code in  
> a repository ? It would help me keep up to date with your changes for  
> cpp, and suggest some patches if they are useful...
>
> regards,
>
> - Niel
>>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: GUI library

Lee Sylvester
Having looked at your demo page, Niel, just so you know, Hugh should
more rightly be considered NME's author, as he's put in far more time,
effort and skill into its construction than I have ;-)

Lee




Hugh Sanderson wrote:

> Excellent idea.  That demo is already looking pretty cool! The code is
> at:
>
> http://code.google.com/p/neash/
>
> Sign up with google code and send me your ID and I
> will add you to project.
>
> Hugh
>
>
>
>> Hugh Sanderson wrote:
>>
>> Hi Hugh,
>>
>>> Another possiblity would be to port neash to javascript too.
>>> This may be a bit of a stretch - I'm not sure how similar
>>> the apis would be.  The good thing would be that you could
>>> use your existing flash code (or anyone elses) to port to
>>> js/flash/neko/cpp.  You would have to be reasonably keen to
>>> take this path though.
>>
>> I have embarked on this route (some progress is on
>> http://cyanescent.co.uk/canvasdemo ), though as you say there are
>> some unsimilarities between the APIs. I've had to modify small parts
>> of Neash, and I am wondering whether you are keeping track of your
>> code in a repository ? It would help me keep up to date with your
>> changes for cpp, and suggest some patches if they are useful...
>>
>> regards,
>>
>> - Niel
>>>
>


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: GUI library

Niel Drummond-3
Lee McColl Sylvester wrote:
> Having looked at your demo page, Niel, just so you know, Hugh should
> more rightly be considered NME's author, as he's put in far more time,
> effort and skill into its construction than I have ;-)
I'm sure you provided plenty of inspiration and lots of reading material :-D

- Niel

>
> Lee
>
>
>
>
> Hugh Sanderson wrote:
>> Excellent idea.  That demo is already looking pretty cool! The code
>> is at:
>>
>> http://code.google.com/p/neash/
>>
>> Sign up with google code and send me your ID and I
>> will add you to project.
>>
>> Hugh
>>
>>
>>
>>> Hugh Sanderson wrote:
>>>
>>> Hi Hugh,
>>>
>>>> Another possiblity would be to port neash to javascript too.
>>>> This may be a bit of a stretch - I'm not sure how similar
>>>> the apis would be.  The good thing would be that you could
>>>> use your existing flash code (or anyone elses) to port to
>>>> js/flash/neko/cpp.  You would have to be reasonably keen to
>>>> take this path though.
>>>
>>> I have embarked on this route (some progress is on
>>> http://cyanescent.co.uk/canvasdemo ), though as you say there are
>>> some unsimilarities between the APIs. I've had to modify small parts
>>> of Neash, and I am wondering whether you are keeping track of your
>>> code in a repository ? It would help me keep up to date with your
>>> changes for cpp, and suggest some patches if they are useful...
>>>
>>> regards,
>>>
>>> - Niel
>>>>
>>
>
>


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Haxe 3.0 flex update

Dinkar Ganti
Hello list,
Is there a haxe library update for flex 3.0? Whats the best method of
generating hxclasses. I tried extracting the swc and running
gen-hx-classes on the swf, it did not seem to have all the mx.* packages
though. I have been using haxe to do most of flex work. I got stuck as i
need to use the flex data visualization components available only in
flex 3.0. Any pointers will help.

Thanks,
Dinkar

--
haXe - an open source web programming language
http://haxe.org

dinkar_ganti.vcf (202 bytes) Download Attachment