Re: Text appended to ComboBox appears blank



Hi,

I haven't had a proper look (just got out of bed :) , but I remember
seeing behaviour like this a while ago in my first attempts at Gtk.
Are you setting up a renderer in the combo box to show the text, and
have you packed it properly? Not sure if that's the problem here, but
it's the mistake I made and looked the same ('empty' drop down that
was the right length).

MB

2009/7/30 Joseph Thames <beartham gmail com>:
Hello list,

I am appending text to a couple of ComboBoxes In the following code snippet:

   clear_text($LeftTreeComboBox) if $ntreesleft;
   clear_text($RightTreeComboBox) if $ntreesright;
   for($i=1; $i<=$count; $i++) {
      $temp = getstack("Archives",$i-1);
      Debug_Info("$i $temp\n");
      append_text($LeftTreeComboBox,$temp);
      append_text($RightTreeComboBox,$temp);
      $ntreesleft = $ntreesright = $count;
   }

where:

sub append_text {
    my ($combobox, $text) = @_;
    my $model = $combobox->get_model;
    $model->set ($model->append, 0, $text);
}

sub clear_text {
   my $combobox = shift;
   my $model = $combobox->get_model;
   $model->clear;
}


but no visible text appears in the ComboBoxes. They both pop down as if text
was appended, but none is visible. The Debug_Info output shows that the
$temp text is there, but is doesn't show up in the ComboBoxes.

The ComboBox ListStore model was previously defined in a callback like the
following, where the ComboBox widget was captured in the global variable
$LeftTreeComboBox.

# Callback name: on_LeftTreeComboBox_expose_event
# Called from widget: LeftTreeComboBox
#
sub on_LeftTreeComboBox_expose_event {
   my ( $self, $widget ) = @_;
   return if $LeftTreeComboBox;
   Debug_Call( "\n");
   $LeftTreeComboBox = $widget;
   my $model = Gtk2::ListStore->new("Glib::String");
   $widget->set_model ($model);
   Debug_Exit("\n");
}


Anyone have an idea what is wrong here?

Thanks
--
Joseph 'Bear' Thames
Meta Science Foundation
(505) 977-9024 - Cell Phone
beartham gmail com

_______________________________________________
gtk-perl-list mailing list
gtk-perl-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list





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