in reply to Re: TK setPalette Not working under Linux Gnome
in thread TK setPalette Not working under Linux Gnome

Just last question. I noticed that the elements such as Canvas and Scale has got a white border around it. Button, Label funny enough doesn't have it. Let me know if you need a screenshot, please. I think it is just another option, but I can't figure out the name. I tried all border related ones... but no luck. Thanks for your great help!
  • Comment on Re^2: TK setPalette Not working under Linux Gnome

Replies are listed 'Best First'.
Re^3: TK setPalette Not working under Linux Gnome
by zentara (Cardinal) on Jun 26, 2007 at 12:04 UTC
    The optionAdd mechanism isn't fully foolproof. You may have to manually add the options to each widget. Each widget will act a bit differently. You might also want to ask on comp.lang.perl.tk, where someone else may know a useful trick or two. As you can see below, the highlightthickness only works on a per widget basis.

    It may be a bit late now, but Gtk2 has better uniformity of control over all widget parameters, in Tk, each widget has a distinct personality.

    #!/usr/bin/perl use warnings; use strict; use Tk; my $mw = tkinit; $mw->optionAdd('*foreground' => 'yellow'); $mw->optionAdd('*background' => 'black'); $mw->optionAdd('*borderwidth' => 0); $mw->optionAdd('*insertborderwidth' => 0); $mw->optionAdd('*selectborderwidth' => 0); $mw->optionAdd('*highlightthickness' => 0); $mw->optionAdd('*hightlightcolor' => 'black'); $mw->optionAdd('*selectbackground' => 'black'); my $f = $mw->Frame(-borderwidth => 0, -highlightthickness => 0, )->pack(-expand => 1, -fill => 'both', ); $f->Label(-text => 'First label')->pack; $f->Text( -highlightthickness => 0 )->pack; my $canvas = $f->Scrolled("Canvas", -highlightthickness => 0 )->pack(); MainLoop;

    I'm not really a human, but I play one on earth. Cogito ergo sum a bum
      Thanks for the explanation. I have it right now. I just added highlightthickness to all my Canvas and Scale widgets. This resolved the problem. Your help is much appreciated!