|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Text appended to ComboBox appears blankHello 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 { 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.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; } 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? -- Joseph 'Bear' Thames Meta Science Foundation (505) 977-9024 - Cell Phone beartham@... _______________________________________________ gtk-perl-list mailing list gtk-perl-list@... http://mail.gnome.org/mailman/listinfo/gtk-perl-list |
|
|
Re: Text appended to ComboBox appears blankHi,
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@...>: > 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@... > > _______________________________________________ > gtk-perl-list mailing list > gtk-perl-list@... > http://mail.gnome.org/mailman/listinfo/gtk-perl-list > > gtk-perl-list mailing list gtk-perl-list@... http://mail.gnome.org/mailman/listinfo/gtk-perl-list |
| Free embeddable forum powered by Nabble | Forum Help |