Subject: | Active Bugs |
Date: | Mon, 25 Mar 2019 17:10:36 +0000 |
To: | "bug-Tk-JComboBox [...] rt.cpan.org" <bug-Tk-JComboBox [...] rt.cpan.org> |
From: | "Campbell, Philip Dale" <Philip.Campbell [...] UHhospitals.org> |
I just ran across the following issue, for which a fix was found at the time (but apparently never reported):
https://www.perlmonks.org/bare/?node_id=799022
First time when I try changing state from 'disabled' to 'normal' to a JComboBox widget it throws an error like this:
Tk::Error: Can't set -state to `normal' for
Tk::JComboBox=HASH(0x84da458): Cannot use undef value for object of
type 'color' at /usr/lib/perl5/site_perl/5.10.0/Tk/JComboBox.pm line
1061.
The proposed solution:
can you try the following patch? (The second change is not related to this issue but seems obvious...)
Cheers, Christoph
--- C:\Dokumente und Einstellungen\chris\Desktop\devel\ngre\Tk\JComboB
+ox-old.pm Mo Okt 30 05:29:15 2006
+++ C:\Dokumente und Einstellungen\chris\Desktop\devel\ngre\Tk\JComboB
+ox.pm So Okt 4 14:05:48 2009
@@ -1030,7 +1030,7 @@
$entry->configure(-background => $bg);
}
}
- if ($fg ne $button->cget('-foreground')) {
+ if ($fg ne $entry->cget('-foreground')) {
$entry->{$SWAP_FG} = $entry->cget('-foreground');
$entry->configure(-foreground => $fg);
}
@@ -1052,7 +1052,7 @@
$entry->configure(-state => 'normal');
return if $Tk::VERSION >= 804;
- my $bg = $entry->{SWAP_BG};
+ my $bg = $entry->{$SWAP_BG};
$entry->{$SWAP_BG} = $entry->cget('-background');
$entry->configure(-background => $bg);
}
Which does resolve the problem for me, as well.
Also, it appears this issue has been resolved (code updated), but the bug-track remains "active":
https://rt.cpan.org/Public/Bug/Display.html?id=73187
And for this bug report:
https://rt.cpan.org/Public/Bug/Display.html?id=60970
Because the original cure (limiting the position of the drop-down) seems worse than the disease (drop-down selections appearing off-screen), I disabled bounds-checking (beginning at line 1324):
## X/Y values must be at least 0, to display popup on screen. Typically,
## this will only ever be a problem for the X value.
# PDC - disable to support multiple-monitor layout
# $popupPosX = 0 if $popupPosX < 0;
# $popupPosY = 0 if $popupPosY < 0;
## X/Y values must not allow the popup to be displayed beyond the maximum
## limits allowed for the screen. Again, this will might happen
# PDC - disable to support multiple-monitor layout
# $popupPosX = $maxX - $popupWidth if (($popupPosX + $popupWidth) > $maxX);
# $popupPosY = $maxY - $popupHeight if (($popupPosY + $popupHeight) > $maxY);
--
Thanks,
pDale Campbell
pDaleC@GMail.com
Visit us at www.UHhospitals.org.
The enclosed information is STRICTLY CONFIDENTIAL and is intended for the
use of the addressee only. University Hospitals and its affiliates disclaim
any responsibility for unauthorized disclosure of this information to anyone
other than the addressee.
Federal and Ohio law protect patient medical information, including
psychiatric_disorders, (H.I.V) test results, A.I.Ds-related conditions,
alcohol, and/or drug_dependence or abuse disclosed in this email. Federal
regulation (42 CFR Part 2) and Ohio Revised Code section 5122.31 and
3701.243 prohibit disclosure of this information without the specific
written consent of the person to whom it pertains, or as otherwise permitted
by law.
Message body is not shown because it is too large.