Tk Source Code

View Ticket
Login
Ticket UUID: 3439581
Title: ttk::style element image auto-adjusts width
Type: RFE Version: None
Submitter: tombert Created on: 2011-11-17 20:51:27
Subsystem: 88. Themed Tk Assigned To: jenglish
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2016-08-22 09:11:38
Resolution: None Closed By: nobody
    Closed on:
Description:
The ttk element image should recalculate it's width each time the image changes.

************
    set inull [image create bitmap]
    set ierror [image create photo -file ".../14x14/error.png"]
    set iwarning [image create photo -file ".../14x14/warning.png"]

    toplevel .tt
    ttk::entry .tt.e1
    pack .tt.e1 -fill x -expand yes

    ttk::style element create Warning image [list $iwarning user1
$inull]
    ttk::style element create Error image [list $ierror user2 $inull]

    ttk::style layout TEntry {Entry.field -sticky nswe -children
{Entry.padding -sticky nswe -children {Error -side right -sticky w
Warning -side right -sticky e Entry.textarea}}}

    .tt.e1 state user2 
***************

Details see here: http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/f397b04c019aed9e/9dd04232b096556b?hl=en#9dd04232b096556b

thx