X7ROOT File Manager
Current Path:
/lib64/python2.7/lib-tk
lib64
/
python2.7
/
lib-tk
/
ðŸ“
..
📄
Canvas.py
(7.29 KB)
📄
Canvas.pyc
(15.2 KB)
📄
Canvas.pyo
(15.2 KB)
📄
Dialog.py
(1.53 KB)
📄
Dialog.pyc
(1.88 KB)
📄
Dialog.pyo
(1.88 KB)
📄
FileDialog.py
(8.62 KB)
📄
FileDialog.pyc
(9.49 KB)
📄
FileDialog.pyo
(9.49 KB)
📄
FixTk.py
(2.95 KB)
📄
FixTk.pyc
(2.04 KB)
📄
FixTk.pyo
(1.98 KB)
📄
ScrolledText.py
(1.79 KB)
📄
ScrolledText.pyc
(2.6 KB)
📄
ScrolledText.pyo
(2.6 KB)
📄
SimpleDialog.py
(3.64 KB)
📄
SimpleDialog.pyc
(4.24 KB)
📄
SimpleDialog.pyo
(4.24 KB)
📄
Tix.py
(75.41 KB)
📄
Tix.pyc
(93.84 KB)
📄
Tix.pyo
(93.84 KB)
📄
Tkconstants.py
(1.46 KB)
📄
Tkconstants.pyc
(2.19 KB)
📄
Tkconstants.pyo
(2.19 KB)
📄
Tkdnd.py
(11.22 KB)
📄
Tkdnd.pyc
(12.52 KB)
📄
Tkdnd.pyo
(12.52 KB)
📄
Tkinter.py
(156.85 KB)
📄
Tkinter.pyc
(195.5 KB)
📄
Tkinter.pyo
(195.5 KB)
ðŸ“
test
📄
tkColorChooser.py
(1.74 KB)
📄
tkColorChooser.pyc
(1.39 KB)
📄
tkColorChooser.pyo
(1.39 KB)
📄
tkCommonDialog.py
(1.38 KB)
📄
tkCommonDialog.pyc
(1.48 KB)
📄
tkCommonDialog.pyo
(1.48 KB)
📄
tkFileDialog.py
(5.59 KB)
📄
tkFileDialog.pyc
(5.04 KB)
📄
tkFileDialog.pyo
(5.04 KB)
📄
tkFont.py
(6.02 KB)
📄
tkFont.pyc
(7 KB)
📄
tkFont.pyo
(7 KB)
📄
tkMessageBox.py
(3.6 KB)
📄
tkMessageBox.pyc
(3.8 KB)
📄
tkMessageBox.pyo
(3.8 KB)
📄
tkSimpleDialog.py
(7.54 KB)
📄
tkSimpleDialog.pyc
(8.9 KB)
📄
tkSimpleDialog.pyo
(8.9 KB)
📄
ttk.py
(54.86 KB)
📄
ttk.pyc
(61.16 KB)
📄
ttk.pyo
(61.16 KB)
📄
turtle.py
(135.78 KB)
📄
turtle.pyc
(136.31 KB)
📄
turtle.pyo
(136.31 KB)
Editing: tkColorChooser.py
# tk common color chooser dialogue # # this module provides an interface to the native color dialogue # available in Tk 4.2 and newer. # # written by Fredrik Lundh, May 1997 # # fixed initialcolor handling in August 1998 # # # options (all have default values): # # - initialcolor: color to mark as selected when dialog is displayed # (given as an RGB triplet or a Tk color string) # # - parent: which window to place the dialog on top of # # - title: dialog title # from tkCommonDialog import Dialog # # color chooser class class Chooser(Dialog): "Ask for a color" command = "tk_chooseColor" def _fixoptions(self): try: # make sure initialcolor is a tk color string color = self.options["initialcolor"] if isinstance(color, tuple): # assume an RGB triplet self.options["initialcolor"] = "#%02x%02x%02x" % color except KeyError: pass def _fixresult(self, widget, result): # result can be somethings: an empty tuple, an empty string or # a Tcl_Obj, so this somewhat weird check handles that if not result or not str(result): return None, None # canceled # to simplify application code, the color chooser returns # an RGB tuple together with the Tk color string r, g, b = widget.winfo_rgb(result) return (r/256, g/256, b/256), str(result) # # convenience stuff def askcolor(color = None, **options): "Ask for a color" if color: options = options.copy() options["initialcolor"] = color return Chooser(**options).show() # -------------------------------------------------------------------- # test stuff if __name__ == "__main__": print "color", askcolor()
Upload File
Create Folder