Menu

#248 Update for the default colour picker

open
5
2007-11-05
2007-11-05
No

With the coming release of Tk 8.5 Donal Fellows asked if
anybody was interested in updating the colour picker
(::tk::dialog::color::) that is used for platforms that
do not offer a native facility. I volunteered.

The attached source uses Tile widgets instead of Tk
widgets, where possible. Further improvements: a better alignment for the label, entry and colour bars.

There is one smallish issue: the Alt-letter bindings
have no effect anymore. This is due to the Tile
widgets - if you change ::ttk::label into ::tk::label
they work again.

Furthermore: I needed extra padding for the selFrame
widget (line 303) otherwise the border of the surrounding
widget was incomplete (especially with the clam theme
under Windows)

Discussion

  • Arjen Markus

    Arjen Markus - 2007-11-05

    Updated version of clrpick.tcl

     
  • Donal K. Fellows

    • labels: --> 34. [tk_chooseColor]
    • assigned_to: nobody --> hobbs
     
  • Joe English

    Joe English - 2007-11-06

    Logged In: YES
    user_id=68433
    Originator: NO

    Re: Alt-KeyPress bindings: this is because ::tk::FindAltKeyTarget explicitly checks [winfo class] of candidate widgets for "Button" and "Label" widgets, and nothing else.

    FWIW, the Tile equivalent (see keynav.tcl) checks for any widget with "-text" and "-underline" options, and sends an <<Invoke>> event to the first one that matches. Tile widgets have built-in bindings for <<Invoke>>; (for ttk::label, mnemonic activation sets focus to the next traversable widget; for buttons, checkbuttons, etc., it does the obvious thing.)

    Re: extra padding needed -- that could be a bug, will look into it; not sure if the ttk::frame handles -borderwidth correctly wrt. geometry management yet.

     
  • Nobody/Anonymous

    Logged In: NO

    Re: extra padding needed -- I don't think I understand the problem. Do you have a smaller test case that demonstrates it?