In article <83173408.0403250954.60fa32f7 / posting.google.com>,
Sean Russell <ser / germane-software.com> wrote:
>ptkwt / aracnet.com (Phil Tomson) wrote in message
>news:<c3tr3a0187b / enews3.newsguy.com>...
>> toolkit-agnostic GUIs.  There was some discussion of this as a project, 
>> I'm just wondering if anyone starting putting anything together.
>
>Yeah, I've got some basic code working using FOX as a backend, but it
>is going slowly.  Not because it is difficult, but because of time
>constraints.  I can already generate UIs with the core widget set from
>XUL.  Basically, it is usable -- in a limited way -- for application
>development, but it isn't very complete.
>
>I need to do some documentation, some packaging, and I wanted to get a
>couple of other back-ends working as proof-of-concept before I
>released it, but if you want a copy, I'll tar it up for you.
>
>> I'm currently deveoping a Ruby/FLTK GUI, but there is some talk about 
>> moving to a Mozilla-based solution and it would be nice if I could just 
>> code up the GUI in XML/XUL and then either generate the FLTK code or take 
>> the XUL directly to Mozilla.
>
>I decided not to use FLTK because FLTK doesn't provide layout
>managers, and I'm not about to write them myself.  XUL uses high-level
>layout mechanisms, so I've been focusing on toolkits (backends) that
>provide these.
>
>You can't use Mozilla, currently, because there's no Mozilla->Ruby
>binding that would allow the Mozilla-generated events to call Ruby
>code.

I'm thinking that we would just use Ruby to generate Mozilla XUL.  We 
would be able to transform our GUI XML descriptions into XUL as one of 
thee targets.  In that case we're generating JavaScript code to handle 
events.

The question is how do we describe event handling code in a toolkit
neutral way (is it even possible)?  I know that in Ruby/FLTK we currently
make heavy use of blocks in a very Ruby-ish way:

  Fl_Button.new(200,310,45,25, "Finish"){|o|
    o.callback(""){|o,ud|
      #rubycode here:
      #that's all folks
      cleanup
      file << report_time
      file.close
      exit
    }
  }

In XUL:

  <button>
    <description lable="Finish" onclick=Finish()/>
  </button>


So how do we describe differnt types of code, maybe:

  <button>
    <description lable="Finish" />
      <Ruby_code ...from above.../>
      <JS_code Finish()/>
  </button>


....just thinking out loud.

Phil