Re: New to GTK+ and a question about Combo boxes.



Kevin Ryde wrote:
2) How come the pulldown lists appear (for lack of a better term)
double spaced?  Is there a fix for that?

If it's not the newlines muppet said then there's also a small amout of
y padding in CellRendererText which annoyed me (over the plain
GtkCList).  Force it down with

    $renderer->set(ypad=>0);

Thanks.  I'll look at the 'set' method.  Here is what worked for me though:

    ...
    my $model = Gtk2::ListStore->new('Glib::String');

    # Load the pulldown list.
    foreach (qw/line1 line2 line3 line4/) {
        $model->set($model->append, 0, $_);
    }

    my $combo_box = Gtk2::ComboBox->new($model);
    my $renderer = Gtk2::CellRendererText->new;

    # Set the row height to 8px. Leave row width at default.
    $renderer->set_fixed_size(-1, 8);

    $combo_box->pack_start($renderer, TRUE);
    $combo_box->add_attribute($renderer, text => 0);




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