Adventures in Python by Craig Richardson

Adventures in Python by Craig Richardson

Author:Craig Richardson
Language: eng
Format: epub, pdf
ISBN: 9781118951842
Publisher: Wiley
Published: 2015-01-23T09:59:13+00:00


Below the line that begins with canvas = tk.Canvas add the following line of code to create the text box: hexText = tk.Entry(window)

Find this line of code in your program: window.mainloop()

Above it, add this line of Python code to add the text box to the window using the grid system: hexText.grid(row=3, column=1, columnspan=3)

Save the program and run it using Run⇒Run Module.

You should notice that the window now has an additional text box at the bottom. Try moving the sliders and you will notice that the value in the text box changes. This value will be the same as the colour used for the background of the canvas.

Figure 4-5 shows the program with the added text box.

FIGURE 4-5 The colour picker with the text box



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.