Archive for December, 2008

Video grabs of ruby curses

December 26, 2008

NOTE: updated demo 1 on Dec 29 with textarea bug fixes, para wrapping, and a quick-dirty file chooser using the existing message box.

Uploaded some video captures of the test programs.
Note: Textarea had wrapping bugs in demo, subsequently fixed.
Demo 1: full screen demo of most widgets (new one uploaded 12/29/08,  7 MB)
Demo 2: message boxes (4)
Demo [...]

Merry Christmas Updates

December 25, 2008

Lots of bells and whistles for Christmas. Such as:
Used ACS_ codes to make neater boxes. The earlier ascii ones were copied from Links. I hope all terminals can access the ACS codes.
Radio and checkbuttons correctly align when align_right set to true.

In Listboxes and buttons, where cursor position is not important, the cursor instead of being [...]

Thoughts on event firing

December 24, 2008

Do UI’s fire events only when someone is listening, or always.
Firing an event often means creating an event object, doing some calculations of what changes were made and what positions they happened in.
Sometimes, one editing event can result in 2 events such as first a delete event and then an insert. Thus, it could be [...]

Event model evolving

December 23, 2008

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 [...]

vt100 and vt200

December 22, 2008

I was pleasantly surprised to find that vt100 and 200 do send keycodes that work correctly with rbcurse. However, in the menubar, highlighting of focussed menuitems and hotkeys was not happening. Made some changes so that highlighting works in both vt100/200 and also screen/xterm.
I am mostly testing under screen and xterm. Are there any other [...]

xterm-color key issues fixed

December 22, 2008

xterm-color blows as a TERM. Even vt100/200, xterm (and xterm-256color) send proper values for F1..F4 and backtab. xterm-color sends a 27,79,80 for F1 (i.e., three keys). So I spent the wee hours of last night hacking some ugly lines into window.getchar() to trap these combinations.
Then i found that backtab is 27,79,81. Added more ugly code [...]

Hotkeys with Labels (and other buttons)

December 21, 2008

We may associate a label with any field/widget with the label_for method. If a mnemonic has been defined for the label, it will register the ALT-key, to transfer keyboard focus to that field.
If that field is a button (responds to fire), its fire will be called.
e.g. we had created some fields in a loop. Now [...]

Horizontal scrolling in single line edit

December 19, 2008

Class Field
Finally got around to doing this. If maxlen > display_length, then the field scrolls horizontally during edit, cursor_back and cursor_forward, and cursor_home (C-a) and cursor_end (C-e).

# Sum some numbers
(5..10).inject {|sum, n| sum + n } #=> 45

[...]

Comboboxes (editable)

December 18, 2008

If a ComboBox is declared as editable, the edit box inserts the entered values as per insert_policy:

NO_INSERT
INSERT_AT_BOTTOM
INSERT_AT_TOP
INSERT_AT_CURRENT
INSERT_AFTER_CURRENT
INSERT_BEFORE_CURRENT

Events are fired appropriately: INTERVAL_ADDED, CONTENTS_CHANGED, INTERVAL_REMOVED as per this link (Contents Changed ). See the demo: testcombo.rb on github. In order to bind events, a listmodel has been created and bound.

[...]

Thoughts on data models and events

December 17, 2008

Should I go towards MVC?
I was completing the editable combo box today. I wanted to fire some events w.r.t data changes in the list. I was directly manipulating the array. No MVC architecture, that is.
Since the list can be manipulated before the listbox has been popped up, and the same events are required in [...]