$widget->visible() not behaving
- From: Daniel Kasak <dkasak nusconsulting com au>
- To: gtk-perl-list gnome org
- Subject: $widget->visible() not behaving
- Date: Tue, 06 Jul 2004 11:47:26 +1000
Hi all.
I'm showing / hiding widgets based on data from a database.
I have the following code, which is currently just to let me know what's
happening:
print "FileNo is: " .
$prospect_data->{records}[$prospect_data->{position}]->{FileNo} . "\n";
if
($prospect_data->{records}[$prospect_data->{position}]->{FileNo} eq '') {
print "in 1\n";
$prospects->get_widget("lbl_FileNo")->visible(0);
$prospects->get_widget("lbl_SubNo")->visible(1);
$prospects->get_widget("lbl_Status")->visible(0);
} elsif
($prospect_data->{records}[$prospect_data->{position}]->{FileNo} == 0) {
print "in 2\n";
$prospects->get_widget("lbl_FileNo")->visible(1);
$prospects->get_widget("lbl_SubNo")->visible(0);
$prospects->get_widget("lbl_Status")->visible(1);
} else {
print "in 3\n";
$prospects->get_widget("lbl_FileNo")->visible(1);
$prospects->get_widget("lbl_SubNo")->visible(1);
$prospects->get_widget("lbl_Status")->visible(1);
}
If I run the code in a debugger ( Komodo ) and step through the if() bit
and check the value of FileNo myself, everything works. It *always*
works in break mode.
But if I *don't* put a break in the debugger, or if I run it from a
terminal via my system's Perl, the above only works the first couple of
times...
My data set starts with FileNo equal to zero, and the code correctly
shows / hides the widgets.
Next my data has a null value, and the code correctly shows / hides the
widgets.
After this, however, even though the if() statements are running the
right portion of code ( which I check from the output of the print()
statement ), the $widget->visible() code doesn't seem to have any effect.
Bug?
--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak nusconsulting com au
website: http://www.nusconsulting.com.au
Title: CanIt Vote for ID 63686
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]