Well, I’m creating a remote gui client so I can deploy a rich network
application. It uses DRb so the client connects to the server and passes up (via the front object) a gui management object. This gui management
object has functions allowing the server to create widgets (or other
objects) at the client end. Works fine for raw GTK, but Glade brings
some interesting challenges.
So, all the logic (including event handlers) are defined at the server
and I need a way of getting the handlers attached to the GladeXML object
as I haven’t figured out a way of passing a block during object creation
which, incidentally, looks like this:
I have created the GladeXML, and I have created an object containing
suitably named handlers (which lives on the server with a DRb proxy
object passed down to the client) but I’m currently trying to figure out
how to wire the two together. Maybe I should migrate to 1.9 which as
String#to_proc apparently, but I want 1.8 compatibility if possible.
Create a class containing the event handlers on the server.
Create a wrapper class containing the GladeXML object on the client.
In the handler creation block, dynamically create local (i.e. in the
wrapper class) instance methods with the same name as the glade signal
and the remote handler function. Local functions call remote ones of
the same name via DRbObject#missing_method.
–
Cheers,
Matt.
“The idea that an arbitrary naive human should be able to properly use a
given tool without training or understanding is even more wrong for
computing than it is for other tools (e.g. automobiles, airplanes, guns,
power saws).” - Doug Gwyn
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.