Posted to tcl by dburns at Mon Feb 08 20:10:10 GMT 2010view raw

  1. # [12:05] jenglish dburns - sure.
  2. # [12:05] dburns I'm busy trying to finish the TTK spt that tclguy started in GUIB, the now open-sourced
  3. # [12:06] dburns gui builder that was active-states....
  4. # [12:06] dburns I'm a ttk tyro, but I've gotten down and dirty on the details, and now have questions that can't be answered by the documentation
  5. # [12:06] dburns here's #1
  6. # [12:07] dburns Taking ttk::label for an example, "-font" seems to be a characteristic that is now controlled by the current theme, right?
  7. # [12:08] dburns and if I query "cget -font", I get "" back, indicating this. right? (it doesn't say so in the docs)
  8. # [12:08] dburns (By "now controlled" I mean as opposed to the old Tk label widget)
  9. # [12:09] jenglish If you explicitly specify a "-font" on a widget that supports it, ([ttk::label], [ttk::entry] &c), that will take precedence.
  10. # [12:09] jenglish If the widget option is blank, it will pick it up from the style database.
  11. # [12:10] dburns Ok, but GUIB attempts to obtain the current font value by doing a cget, and a "" means "comes from the style database" if I here you correctly
  12. # [12:11] jenglish ... and the value it gets from the style database will always be one of the standard Tk named fonts (TkDefaultFont, TkTextFont).
  13. # [12:11] dburns Now if my GUIB user sets it explicitly to "helvetica", and then wants to change it BACK to the TTk theme default, GUIB should set "" into "-font"
  14. # [12:11] jenglish Right.
  15. # [12:11] dburns Ok...here's the rub
  16. # [12:12] dburns For "-justify", a "cget -justify" on a TTk widget returns "" (which I interpreted as meaning the same thing)
  17. # [12:12] dburns but
  18. # [12:12] dburns when I try to set a "" (to indicate "take the theme default"), it is rejected as a valid value. So now I'm thinking that -justify is not controlled by the theme..but again the docs don't say.
  19. # [12:13] dburns (Either the code or the docs should be changed, it seems to me)
  20. # [12:14] jenglish dburns: the rule is the same for all widget options: if it's specified on the widget, that value takes precedence. Otherwise it's looked up from the style database. If it's not found there, then a built-in default will be used.
  21. # [12:14] dburns My point is I cannot revert "-justify" by setting it to "" as I can with -font. What's the scoop on this?
  22. # [12:15] jenglish hm.... though there are a few glitches. In some cases [ttk::label -justify], [ttk::entry -font], the only way to get an empty option value is to never set it.
  23.  
  24.  
  25. Further on, he adds:
  26. # [12:28] jenglish BTW, the aforementioned glitches are caused by 967209
  27.  
  28.