| Lamprecht 2007-10-11, 7:07 pm |
| roberts.cse@gmail.com schrieb:
> Hi All,
>
> Please find the following independent application to reproduce the
> issue.
>
> click on check
> click on choose color
> ===> Now check the predefined color in this dialog box. It is shown on
> the left side.
>
> choose a color and press ok
> again click on check and choose color
>
> ===> Try to see the predefined colors. You will find none.
>
>
> I don't know whether the issue is there due to perl/tk installation.
> Any help is appreciated.
>
> Thanks in advance.
> /Robert
>
Hi,
I can reproduce the behaviour of your example with 804.027_500 (linux)
and 804.027_501 (macos).
Here is a workaround (it seems, that Tk's chooseColor Dialog does not
want its parent to be destroyed...)
Christoph
use warnings;
use strict;
use Tk;
my $newColor='';
my $mw=MainWindow->new(-title=>'SpyGlass Power Browser');
my $tl;
my $but=$mw->Button(-text=>'check',-command=>\&func)->pack;
sub func{
if (Tk::Exists($tl)){
$tl->deiconify;
$tl->raise;
return;
}
$tl=$mw->Toplevel(-title=>'top level');
my $but2=$tl->Button(-text=>'choose color',-command=>\&func2)->pack;
}
sub func2
{
$newColor=$tl->chooseColor(-title=>"Choose Color for Range ",
-parent=>$tl);
$tl->withdraw;
}
MainLoop;
|