The Accidental Rubyist

invalid byte sequence in UTF-8

Event model evolving

leave a comment »

Rubycurses’ event model is undergoing a lot of change currently: in terms of parameters passed. Last night, modified it so multiple actions can be bound to an event of an object.

However, the parameters passed to an event when fired is what is also undergoing change, as i test and play around with the same. At present way, we reference to the current object (that underwent the event). That gives the user flexibility to call whatever methods s/he wants. However, the user then has to go through documentation to figure out what he wants.

Thus, I am thinking of moving all events to an Event object (as is already the case with ListData events). The Event object will contain a ref to the source object, as well as a relevant method such as selected_item, selected_index, value, event_type, etc as appropriate to that class of events.

In addition, I might change some event names, (current ones were taken from Tk, but I’ve left Tk behind long back). I also need to change some method names before this library starts getting used.


Written by totalrecall

December 23, 2008 at 2:54 pm

Posted in rbcurse

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: