gutopia-dev
[Top][All Lists]
Advanced

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

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


From: Tom Sawyer
Subject: Re: [rgui-dev] Idea for binding to the low level api
Date: 30 Aug 2002 08:59:31 -0600

back to this....
 
> 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
> 

so let me see if i understand correctly. myApp is the M in MVC? what
i've been calling the core-application? and myModel is a GUI model? so
myModel would be GUtopIa syntax for defining the GUI's structure, or it
could be markup per massimiliano's ideas? is that right?

then this generator would generate the corresponding gtk, tk, or
whichever api's code from that?

assuming i basically understand this correctly...

i'm thinking about what the code for generating all this would be like,
and i'm wondering how much different it would be from the prior way of
doing it, i.e. wrapped classes, except that the code of those classes
would be stored in strings, to be executed, rather then executed
presently.

i think when you add in massimiliano's idea of taking it a step further
and generating myapp_gtk.rb or myapp_tk.rb then you do get some
advantages out of this approach. faster execution priamrily.

so were talking about a code generater, rather then a real-time
transalator. i wonder how much dynamicism we might loose doing this? for
instance if the app caused an event to be remapped to a different
procedure. i suppose it would still be possible. but how tricky would
this be to code this way though? i'm not sure.

something to think on...

~tom





Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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