Update README.md

Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
David Rotermund 2024-01-08 12:01:21 +01:00 committed by GitHub
parent 609d8b8b53
commit 7605f03c9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -120,6 +120,9 @@ Widget options:
|yscrollcommand=|Specifies the prefix for a command used to communicate with vertical scrollbars. This option is treated in the same way as the xscrollcommand option, except that it is used for vertical scrollbars and is provided by widgets that support vertical scrolling. See the description of xscrollcommand for details on how this option is used. The default value is to call no function.| |yscrollcommand=|Specifies the prefix for a command used to communicate with vertical scrollbars. This option is treated in the same way as the xscrollcommand option, except that it is used for vertical scrollbars and is provided by widgets that support vertical scrolling. See the description of xscrollcommand for details on how this option is used. The default value is to call no function.|
|yscrollincrement=|Specifies an increment for vertical scrolling, in the form of any valid Tk length. If the value of this option is greater than zero, the vertical view in the window will be constrained so that the canvas y coordinate at the top edge of the window is always an even multiple of yscrollincrement; furthermore, the units for scrolling (e.g., the change in view when the top and bottom arrows of a scrollbar are selected) will also be yscrollincrement. If the value of this option is less than or equal to zero, then vertical scrolling is unconstrained. The default value is 0.| |yscrollincrement=|Specifies an increment for vertical scrolling, in the form of any valid Tk length. If the value of this option is greater than zero, the vertical view in the window will be constrained so that the canvas y coordinate at the top edge of the window is always an even multiple of yscrollincrement; furthermore, the units for scrolling (e.g., the change in view when the top and bottom arrows of a scrollbar are selected) will also be yscrollincrement. If the value of this option is less than or equal to zero, then vertical scrolling is unconstrained. The default value is 0.|
![image_logo](image_logo.png)
[Test image](ISee2.png)
```python ```python
import tkinter as tk import tkinter as tk
@ -127,32 +130,27 @@ import tkinter as tk
from PIL import Image, ImageTk from PIL import Image, ImageTk
import os import os
root = tk.Tk()
class GUILogoGUI: logo_filename: str = os.path.join("ISee2.png")
logo: tk.Canvas pil_image = Image.open(logo_filename)
logo_image: int pil_imagetk = ImageTk.PhotoImage(pil_image)
my_tk_root: tk.Tk canvas_width: int = pil_image.width
canvas_height: int = pil_image.height
pic_path: str = os.path.join("gui", "logo") logo = tk.Canvas(root, width=canvas_width, height=canvas_height)
logo.pack()
def __init__(self, tk_root: tk.Tk): logo_image = logo.create_image(
self.my_tk_root = tk_root 0,
0,
anchor=tk.NW,
image=pil_imagetk,
)
logo_filename: str = os.path.join(self.pic_path, "ISee2.png") root.mainloop()
pil_image = Image.open(logo_filename)
self.pil_imagetk = ImageTk.PhotoImage(pil_image)
canvas_width: int = pil_image.width
canvas_height: int = pil_image.height
self.logo = tk.Canvas(self.my_tk_root, width=canvas_width, height=canvas_height) del root
self.logo.pack()
self.logo_image = self.logo.create_image(
0,
0,
anchor=tk.NW,
image=self.pil_imagetk,
)
``` ```