Home > Archive > PerlTk > October 2007 > The list of predefined colors in color chooser widget becomes empty
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 |
The list of predefined colors in color chooser widget becomes empty
|
|
| roberts.cse@gmail.com 2007-10-11, 4:16 am |
| 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.
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
{
$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->destroy;
}
MainLoop;
I don't know whether the issue is there due to perl/tk installation.
Any help is appreciated.
Thanks in advance.
/Robert
| |
| smallpond 2007-10-11, 7:07 pm |
| On Oct 11, 3:09 am, roberts....@gmail.com wrote:
> 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.
>
> 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
> {
> $tl=$mw->Toplevel(-title=>'top level');
> my $but2=$tl->Button(-text=>'choose color',-command=>\&func2)-
>
> }
>
> sub func2
> {
> $newColor=$tl->chooseColor(-title=>"Choose Color for Range ",
> -parent=>$tl);
> $tl->destroy;
>
> }
>
> MainLoop;
>
> I don't know whether the issue is there due to perl/tk installation.
> Any help is appreciated.
>
> Thanks in advance.
> /Robert
On Windows, perl/Tk uses the native color chooser widget,
which varies depending on which version of Windows you are
running. On other OSes, it uses Tk::ColorEditor which does
not have a 'predefined' selection.
You can specify an '-initialcolor' attribute, if that helps.
--S
| |
| Slaven Rezic 2007-10-14, 8:03 am |
| roberts.cse@gmail.com writes:
> 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.
>
>
> 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
> {
> $tl=$mw->Toplevel(-title=>'top level');
> my $but2=$tl->Button(-text=>'choose color',-command=>\&func2)-
> }
>
>
> sub func2
> {
> $newColor=$tl->chooseColor(-title=>"Choose Color for Range ",
> -parent=>$tl);
> $tl->destroy;
> }
>
> MainLoop;
>
>
> I don't know whether the issue is there due to perl/tk installation.
> Any help is appreciated.
>
An even smaller testcase directly from command line.
$ perl -MTk -MTk::ColorEditor -e '$mw=tkinit;$mw->ColorSelect->pack;$c=$mw->ColorSelect->pack;MainLoop'
This is now solved in the Perl/Tk SVN repository:
------------------------------------------------------------------------
r10080 | srezic | 2007-10-14 13:27:03 +0200 (So, 14 Okt 2007) | 7 lines
Geänderte Pfade:
M /Tk/trunk
M /Tk/trunk/MANIFEST
M /Tk/trunk/Tk/ColorEditor.pm
A /Tk/trunk/t/coloreditor.t
r1861@biokovo-amd64: eserte | 2007-10-14 13:26:50 +0200
* solved chooseColor issue reported in
http://groups.google.com/group/comp...a1f994f532648be
(only first color dialog gets a color list)
* additional tests for ColorEditor
* make sure a destroyed waiting color dialog does not "block" the application
------------------------------------------------------------------------
Regards,
Slaven
--
Slaven Rezic - slaven <at> rezic <dot> de
sf-upload: make batch releases on SourceForge
http://sf-upload.sf.net
| |
|
|
|
|
|