The Accidental Rubyist

invalid byte sequence in UTF-8

Comboboxes (non-editable)

leave a comment »

I have fixed on some specs for combo-boxes.

Non-editable combo boxes just implemented as follows:

  • Alt-Down pops up a selectable list.
  • Pressing UP and DOWN key moves through values in @values list.
  • Pressing any key will display next match starting with that key, cycling at end.

Will work on editable combos next. Not sure of standard behaviour. Will append entered value upon tabbing out based on insert policy.

non editable combo box

non editable combo box

      combo = ComboBox.new @form do
        name "combo"
        row 19
        col 22
        display_length 10
        editable false
        values %w[scotty tiger secret pass torvalds qwerty quail toiletry]
          set_label Label.new @form, {'text' => "Combo"}
      end

Current issues: adjust size of popup window so it does not go off window. In attached screenshot, it goes off.

Advertisements

Written by totalrecall

December 17, 2008 at 1:09 am

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: