Skip Menu |

This queue is for tickets about the Tk-JComboBox CPAN distribution.

Report information
The Basics
Id: 14520
Status: resolved
Priority: 0/
Queue: Tk-JComboBox

People
Owner: Nobody in particular
Requestors: tjtoocool [...] phreaker.net
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.06
Fixed in: 1.09



Subject: Bug #12372
JComboBox 1.08, 5.8.7 ActiveState on Windows XP (The problem also exists on linux, as well) The patch for 12372 is definitely necessary concerning JComboBoxes within a DialogBox. Commenting it out removes the DialogBox grab, which sucks. However, something still isn't right. After selecting an item within a JComboBox within a DialogBox, exiting the DialogBox and then selecting something in a JComboBox within MainWindow, JComboBox tries to restore focus to the last DialogBox that was opened. If the DialogBox was withdrawn, the grab will be shifted to the withdrawn window and the mainwindow will appear to be frozen (though it can still accept keyboard input I've noticed). If the DialogBox was destroyed, it will throw an error similar to: Tk::Error: XStoSubCmd: Not a Tk Window Tk::die_with_trace at C:/Perl/site/lib/Tk/JComboBox.pm line 562 Tk::JComboBox::hidePopup at C:/Perl/site/lib/Tk/JComboBox.pm line 1423 Tk::JComboBox::ButtonRelease at C:/Perl/site/lib/Tk.pm line 411 (eval) at C:/Perl/site/lib/Tk.pm line 411 Tk::MainLoop at test.pl line 16 Tk::die_with_trace at C:/Perl/site/lib/Tk.pm line 475 Tk::JComboBox::hidePopup at C:/Perl/site/lib/Tk/JComboBox.pm line 562 Tk::JComboBox::ButtonRelease at C:/Perl/site/lib/Tk/JComboBox.pm line 1423 <ButtonRelease-1> (command bound to event) Simply because it's still trying to access the destroyed dialog box. I've included a test case below. Meanwhile I'm searching through the JComboBox code myself to see if I can figure something out. If I do I'll post it, but perhaps you will find the solution before me... :) #!/usr/bin/perl use Tk; use Tk::Dialog; use Tk::JComboBox; $mw = MainWindow->new(); $mw->idletasks; $combo = $mw->JComboBox()->pack(-side => 'left'); $combo->addItem("Item 1"); $combo->addItem("Item 2"); $button = $mw->Button(-command => \&dialogofdeath, -text => 'Launch Dialog')->pack(-side => 'left'); MainLoop; sub dialogofdeath { $dialog = $mw->DialogBox(); $newcombo = $dialog->JComboBox()->pack(); $newcombo->addItem("Item 1"); $newcombo->addItem("Item 2"); $dialog->Show(); $dialog->withdraw(); #$dialog->destroy(); }
[guest - Thu Sep 8 16:19:05 2005]: Show quoted text
> JComboBox 1.08, 5.8.7 ActiveState on Windows XP (The problem also > exists on linux, as well) >
Thanks for the bug report -- seems pretty obscure, but I think I've got a fix in place. I'm still testing it, but so far, so good. Rob
The following code in the hidePopup() method: if ($Tk::oldGrab and $Tk::oldGrabStatus) Needs to be modified to something like: if ($Tk::oldGrab && $Tk::oldGrabStatus && Exists($Tk::oldGrab) && $Tk::oldGrab->ismapped) And that seems to fix both problems. It will be in the next release. Rob
From: tjtoocool [...] phreaker.net
Thanks Rob. You're the man :)
[guest - Thu Sep 8 16:19:05 2005]: Show quoted text
> JComboBox 1.08, 5.8.7 ActiveState on Windows XP (The problem also > exists on linux, as well) >
Thanks for the bug report -- seems pretty obscure, but I think I've got a fix in place. I'm still testing it, but so far, so good. Rob