For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > October 2007 > Re: The list of predefined colors in color chooser widget becomes









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: The list of predefined colors in color chooser widget becomes
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;
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com