On 30/03/2011 10:24 AM, vwf wrote:
On Wed, Mar 30, 2011 at 09:44:50AM -0700, Jeff Hobbs wrote:
On 30/03/2011 4:19 AM, vwf wrote:
I want to change the appearance of a Tkx widget, but it behaves
different than expected:

my $frame = $mw->new_ttk__labelframe(
          -text        =>   "test",
          -labelanchor =>   'nw',
      );
$frame->configure(-text =>   "TEST"); #works
$frame->configure(-foreground =>   "red"); #does NOT work, -foreground not 
recognised

How do I change colors in Tkx?

ttk widgets (Themed Tk) work off the principle of styles and states,
ignoring many individual widget configuration options.  For styling the
labelframe, see:

http://wiki.tcl.tk/20054

This is a challenge (Tcl), but I made something working:

my $frame = $mw->new_ttk__labelframe(
           -text        =>   "test",
           -labelanchor =>   'nw',
       );
Tkx::ttk__style_configure("test.TLabelframe", -background =>  "red");
$frame->configure(-style =>  "test.TLabelframe");

This does make the entire labelframe-area red. I would like to have the
label "test" and the line around the frame in red. foreground does not
show any effect. Do you know what does?

You want to adjust the Tlabelframe.Label -background, not the frame. I'm not sure if you can customize to the level of the frame line. The point of themed widgets is to follow the theme, thus they have fewer options. Why break the user chosen theme?

Jeff

Reply via email to