Text appended to ComboBox appears blank
- From: Joseph Thames <beartham gmail com>
- To: gtk-perl-list gnome org
- Subject: Text appended to ComboBox appears blank
- Date: Wed, 29 Jul 2009 12:36:50 -0600
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]