The Accidental Rubyist

invalid byte sequence in UTF-8

Big internal changes amiss

leave a comment »

Some major changes (internal)

### firing property change

1. In order not to repaint the entire form each time, we must only repaint a widget when modified. However, as can be seen, widgets are being modified by other widgets. Thus whenever a property is changed, we need a flag to be set that repainting is required.

### dsl_property

Thus, copied dsl_accessorand made dsl_property. Whenever, such props are modified, a property change is now fired, and repaint_required is set to true. I am currently changing this. What this means is that on startup, fire_prop_change will be called many times, and i need to avoid this on first time instantiation. TODO.

2. The tricky part was text_variables. When their value changes, any widget (such as label) automatically changes. NOW: When a text_variable is defined for field, internally that field, adds itself as a dependent. When its value is changed, it fires a change to the dependent field.

3. The real worrisome part was this:

When user passes in a hash in the constructor, i was directly setting variables, NOT calling methods. Tracked this down. Now i am calling methods and not setting variables. See rwidget.rb variable_set (top). Only thorough testing will tell how much this change will affect stuff. Maybe not.

4. Rewriting Listboxes: the scrolling and painting logic was crap. I did not understand modules then. I think I have had an insight into modules and classes now. Also, a ListCellRenderer is being used, as in Table.

So basically, things are going to be unstable for a week or so.

Advertisements

Written by totalrecall

January 8, 2009 at 1:50 am

Posted in rbcurse, ruby

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: