The Accidental Rubyist

invalid byte sequence in UTF-8

Progress on SplitPane and ScrollPane

leave a comment »

Great progress on rbcurse’s Scrollpanes and Splitpanes. Scrollpanes contain a viewport which handles the window or porthole into it’s child object. The scrollpane handles communication with the viewport, and the scrollbars. I’ve just added some neat scrollbars. However, there’s a lot of drudge work to be done such as event listeners, and allowing editable objects inside scrollpanes and splitpanes.

rbcurse scrollpane

Scrollpane using ncurses

Splitpanes: tested a splitpane with 2 splitpanes as its child components. However, have to use real world objects inside that. Objects that go inside scroll and splitpanes need to be buffered using pads. That and their handling of cursor position etc need to be taken care of.

SplitPane using ncurses (rbcurse)

SplitPane using ncurses (rbcurse)

A major change in the upcoming version (0.1.3), is that widgets will no longer write directly onto the screen. That was quick and easy and light. But for real world apps, when one has splitpanes, scrollpanes etc, then parent objects need to clip and place their child objects themselves. Child widgets don’t even know their coordinates. So using pads internally was required.

That means that most of the existing classes will need to be modified to use pads for painting. A lot of drudge coding. May need to make borders and scrollbars into classes. The upcoming version should be exciting. Now it should be possible to make a Tree class, too.


# print section of file from regex to end of file
$ cat | ruby -pe ‘@found=true if $_ =~ /regex/; next unless @found’

Advertisements

Written by totalrecall

November 1, 2009 at 10:55 pm

Posted in ncurses, 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: