Re: GtkCombo vs GtkComboBoxEntry: scrollbars

On Aug 23, 2004, at 6:46 PM, Daniel Kasak wrote:

This is probably a Gtk issue more than a Gtk-Perl issue, but still ... does anyone know if I can get a scrollbar ( easily ) on my ComboBoxEntry widgets?

you can set the style property GtkComboBox::appears-as-list, but that doesn't work quite right in gtk+ 2.4.x... the popup window doesn't have a scrolledwindow in it, so when the list is long, it's unusable. there's gtk+ bug logged about this:

gtk+ shows more recent activity on this than bugzilla: rev=1.102&view=markup

if you build gtk+ out of cvs (e.g. with jhbuild) then this code works:

  use strict;
  use Gtk2 -init;
  my $window = Gtk2::Window->new;
  my $model = Gtk2::ListStore->new ('Glib::String');
  foreach (0..50) {
      $model->set ($model->append, 0, "thing $_");
  my $cb = Gtk2::ComboBoxEntry->new ($model, 0);
  $cb->set_name ('little-jerry-seinfeld');
  Gtk2::Rc->parse_string ('
  style "my-style" { GtkComboBox::appears-as-list = 1 }
  widget "*.little-jerry-seinfeld" style "my-style"
  $window->add ($cb);
  $window->signal_connect (destroy => sub {Gtk2->main_quit});

"the ternary operator makes it a bit less ugly."
    -- kaffee

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]