The Accidental Rubyist

invalid byte sequence in UTF-8

Textview gets multiple buffers

leave a comment »

I should be testing and bringing out a stabler release, but can’t resist adding more. I’ve extended TextView so one can have multiple buffers open and cycle between them. The motivation is that often instead of a tabbedpane, we might want to just have many documents open. This is much easier. An application is an SQL client, where i have multiple resultsets and I want to cycle between resultsets and not keep rerunning queries.

I’ve mapped in the new Most-style menu to “:” so buffer navigation can happen on “:bp” “:bn” etc as in vim. “e” and “C-x f” allow opening a new file (buffer). The Most-style menu is a simple, cute menu just like the application most has. Easy to set options and suboptions, and attach Procs or symbols to execute. I’ve called it PromptMenu since it prompts for selection. Using a Prompt menu means the user does not have to remember keys, just pressing “:” will bring up a menu.

This component is called MultiTextView and extends TextView. I’d like to actually make it a module, so TextArea and Listbox and Table can just include it and get all the functionality without my having to extend it for each.

Advertisements

Written by totalrecall

March 11, 2010 at 9:00 pm

Posted in rbcurse

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: