in reply to TK setPalette Not working under Linux Gnome

Well this works for me on linux. I use ICEWM and the latest Xserver version. May say what Tk, distribution, Perl, and Xserver versions you have going.

Ugly.... but demonstrates it works.

#!/usr/bin/perl use warnings; use strict; use Tk; my $types = [['Format Perl', '.pl']]; my $mw = new MainWindow ( ) ; $mw->setPalette(background=>'black', foreground=>'white'); my @files; $mw -> Button ( -text => 'Select File ' , -command => \&open_it )-> pack(-padx=>5, -pady=>5) ; MainLoop ( ) ; sub open_it { my $names = $mw ->getOpenFile ( -initialdir => '.', -filetypes => $types, -multiple => 1) ; foreach my $file( @{$names} ){ print "Result ", $file, "\n" ; } }

I'm not really a human, but I play one on earth. Cogito ergo sum a bum

Replies are listed 'Best First'.
Re^2: TK setPalette Not working under Linux Gnome
by avo (Pilgrim) on Jun 24, 2007 at 20:36 UTC
    Yeah, it works, but only under FVWM or plain X. I guess ICEWM falls under these. I tried it under KDE and Gnome... doesn't work. I think the window manager somehow overrides the palette colors. I am not sure, and very confused. In fact I don't know what I must do next. My application is quite large, and I don't feel like changing all Frames, top levels, etc. to have an option for background and foreground ... I know that you can recursively change all children's background for instance. But not all my windows are loaded... I load them dynamically. My application works fine in FVWM. I would appreciate any input. Thanks Zentara.