gutopia-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[rgui-dev] Idea for binding to the low level api


From: Rich Kilmer
Subject: [rgui-dev] Idea for binding to the low level api
Date: Thu, 29 Aug 2002 21:52:54 -0400

Tom,

Had a thought tonight on the way home.  I was using VRuby today and as I
was coding it I looked at this code and thought...man I wish I could
just generate this stuff.  So here is the idea.  Instead of building a
binding library for a low-level toolkit...creating Classes to wrap each
widget, etc, build a generator class that accepts the metadata
(application/model), and builds a String that represents the Toolkit
code; then evals the code into the interpreter.  Maybe the code could be
encapsulted in a Proc that accepts parameters like:


class GTKGenerator
  def GTKGenerator.generate(myApp, myModel)
    code = "Proc.new do |application, model|\n"
    
    ...lots of stuff generated here which
    represents all the widget creation that
    the toolkit needs, setting up bindings
    to events, etc...

    code << "end"
    proc = eval(code)
    proc.call(myApp, myModel)
  end
end

Or something to that regard.  I know how I would do this with my
original Utopia design, but not quite yours.

Anyway...that was the thought...hope it makes sense.

-Rich






reply via email to

[Prev in Thread] Current Thread [Next in Thread]