Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

chooseColor pb

6 views
Skip to first unread message

Johnny "Gandalf" Brasseur

unread,
Jul 16, 2004, 5:59:39 PM7/16/04
to
Hi , i have a strange behavior when using the chooseColor function on my
linux box.
May be i use it the wrong way.
The chooseColor seems to be running quite well under MSWin32 but on my linux
box the chooseColor window appears but freezes (nothing seems active as if
it couldn't get the focus) : i have to close it with the X button.

Any idea ?

a code snippet =>
sub menuOptions {
my $dl = $mw->Dialog(
-title=>'Options',
-buttons=> [qw/Ok Cancel/],
);
my $fr = $dl->Frame(-class => 'options' );
$fr->Label(-text=>'Couleur Ch Noir') ->grid(
$fr->Entry(-textvariable=>\$CH_BLACK),
$fr->Button(-text=>'...',-command=> sub {
my $color1 = $fr->chooseColor(
-initialcolor=>$CH_BLACK,
-title=>'Selectionnez la couleur du ch NOIR');
$CH_BLACK=$color1 if defined $color1;
})
);
../..
$fr->pack;
my $ans = $dl->Show;
if( $ans eq 'Ok' ) {
doSomeUpdate(); #etc..
}
}

--
Johnny "gandalf" Brasseur (http://www.perlone.org)

Johnny "Gandalf" Brasseur

unread,
Jul 17, 2004, 4:59:59 AM7/17/04
to
I'll answer myself as i saw an answer in the archives.
@see : "chooseColor not working properly"
here :
http://groups.google.fr/groups?hl=fr&lr=&ie=UTF-8&threadm=Pine.GSO.4.31.0207191851270.6162-100000%40ux5.cso.uiuc.edu&rnum=1&prev=/groups%3Fq%3DchooseColor%2Btk%26hl%3Dfr%26lr%3D%26ie%3DUTF-8%26selm%3DPine.GSO.4.31.0207191851270.6162-100000%2540ux5.cso.uiuc.edu%26rnum%3D1

All i have to do is this :
$dl->grabRelease();
# before


> my $color1 = $fr->chooseColor(

#and
$dl->grabCurrent();
# after
in order to release keyboard and mouse grabing and refocus it back to the
calling dialog window. So simple.
I tested it, it works !
see ya

comen...@gmail.com

unread,
Mar 30, 2013, 7:07:21 AM3/30/13
to
Thank you, your post has helped me a lot!
0 new messages