The Accidental Rubyist

invalid byte sequence in UTF-8

Rewrite of Tabbedpane

leave a comment »

As promised, a much cleaner version of TabbedPane, makes sense. One may add components directly without creating a form. When a component is added directly, the Tabbedpane can resize and position the component appropriately.
However, TabbedPane does not create a Pad-based form like it earlier did by default. If we wish to place multiple components in a TabbedPane we need to call TabbedPane.form(tab) passing the tab.

Pressing a down arrow on the buttons above, takes focus to the tab below. Also, there is the option of displaying the tab as we traverse through the buttons. This mimics MicroEmacs behavior in User Setup. Otherwise by default, tabbedpanes behave like Terminal’s Preference Pane (in OSX) – we have to press a button, or use hotkey for tab to be displayed.

I still have to work on handling more buttons that can be seen on the tabbedpane component, much like Firefox.

Syntax for adding a tab is now:

tab1 = tp.add_tab “&TextView”, textview

The above requires textview to be created before the call. ALternatively, one can add the component later.

tab1 = tp.add_tab “&TextView”
# create textview here
tab1.component = textview


Written by totalrecall

March 2, 2010 at 12:53 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: