«Any ideas are welcome»

OK, if so - and you want that your GUI looks really cool, please take a look at Flex as well as ActionScript.

IMHO this stuff has some benefits:

  1. Very easy handling of that asynchronous HTTP stuff
  2. Nice data binding concept
  3. ActionScript is how JavaScript should be: typification, class keyword, no need to use prototype. It is a nice language.
  4. Each class you create can have two incarnations: (M)XML and ActionScript code. This goes far beyond that "MarkUp for the Visual Things/Code For The Logic" approach. You can very easily do something similar to Code-Behind.
  5. If you do this and then think about doing some "micro MVC" stuff, things become interesting. Do the basic layout in MXML. Write your classes in ActionScript, based on <s:Group>. E.g. one containing a button, another a data grid for displaying your data and one with some of the XML list objects of Flex for the data and a http service for the fetch as a kind of delegate. A group doesn't listen for any events by default. edit: Bullshit, forgot my own cheated stuff ;-( So overwrite the built-in event dispatcher class see example below, define your custom events , build the listeners and the corresponding handlers, instantiate your AS classes as MXML and the fun begins...

(Simplified, i know...)

edit: Example:

package Events { /* http://www.kirupa.com/forum/showthread.php?223798-ActionScript- +3-Tip-of-the-Day/page6 Note that addEventListener only takes functions as listeners, not +objects. Also remember that class methods are bound to their instances so w +hen used as listeners, 'this' in the event call still references the orginal c +lass instance no matter what object dispatched the event. By extending the EventDispatcher class or any class that inherits +from it like Sprite (all DisplayObjects are inherently EventDispatchers +), your class gains access to the EventDispatcher methods. Then, other instances (or the class instance itself) can add methods to instances of that class using addEventListener and in turn they can call those events through dispatchEvent. If there is some reason your class cannot inherit from the EventDi +spatcher class for example, if its already inheriting from another class w +hich does not inherit from EventDispatcher), then you can use the Event +Dispatcher constructor to intialize your class instance with the methods of E +ventDispatcher via aggregation (composition). Just make sure you implement the IEventDispatcher interface (flash +.events.IEventDispatcher)*/ import flash.events.Event; import flash.events.EventDispatcher; import flash.events.IEventDispatcher; import flash.utils.getQualifiedClassName; public class MyDispatcher implements IEventDispatcher { private var eventDispatcher:EventDispatcher; public function MyDispatcher() { trace("new " + getQualifiedClassName(this)); eventDispatcher=new EventDispatcher(this); } public function addEventListener(type:String, listener:Functio +n, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean +=false):void { eventDispatcher.addEventListener(type, listener, useCaptur +e, priority, useWeakReference); } public function dispatchEvent(event:Event):Boolean { return eventDispatcher.dispatchEvent(event); } public function hasEventListener(type:String):Boolean { return eventDispatcher.hasEventListener(type); } public function removeEventListener(type:String, listener:Func +tion, useCapture:Boolean=false):void { eventDispatcher.removeEventListener(type, listener, useCap +ture); } public function willTrigger(type:String):Boolean { return eventDispatcher.willTrigger(type); } } }
package Events { import flash.utils.getQualifiedClassName; public final class MyEventDispatcher extends MyDispatcher { private static var _instance:MyEventDispatcher; public function MyEventDispatcher(dummy:Dummy):void { super(); if (dummy === null) { throw new Error("Call CustomEventDispatcher as CustomE +ventDispatcher.instance!"); } } public static function get instance():MyEventDispatcher { if (_instance === null) { _instance=new MyEventDispatcher(new Dummy()); trace("new instance " + getQualifiedClassName(_instanc +e)); } trace("get instance " + getQualifiedClassName(_instance)); return _instance; } } } internal class Dummy { }

The price you have to pay for this: it's Shockwave/Flash :-(

OK, nobody is perfect.

You can do this stuff using vi or emacs or better use FlashBuilder, a tool based on Eclipse. Some free GUIs are around - i didn' use them yet.

Best regards, Karl

«The Crux of the Biscuit is the Apostrophe»


In reply to Re: Cross-platform GUI for UNIX based scripts by karlgoethebier
in thread Cross-platform GUI for UNIX based scripts by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.