Skip to content

Commit eb84f60

Browse files
author
Tom Schimansky
committed
changed map_with_customtkinter.py layout
1 parent d324284 commit eb84f60

1 file changed

Lines changed: 13 additions & 14 deletions

File tree

examples/map_with_customtkinter.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
import customtkinter
33
from tkintermapview import TkinterMapView
44

5+
customtkinter.set_appearance_mode("dark")
6+
customtkinter.set_default_color_theme("dark-blue")
7+
58

69
class App(customtkinter.CTk):
710

@@ -29,33 +32,29 @@ def __init__(self, *args, **kwargs):
2932
self.grid_columnconfigure(1, weight=1)
3033
self.grid_rowconfigure(0, weight=1)
3134

32-
self.frame_left = customtkinter.CTkFrame(master=self,
33-
width=150)
34-
self.frame_left.grid(row=0, column=0, padx=20, pady=20, sticky="nsew")
35+
self.frame_left = customtkinter.CTkFrame(master=self, width=150, corner_radius=0)
36+
self.frame_left.grid(row=0, column=0, padx=0, pady=0, sticky="nsew")
3537

36-
self.frame_right = customtkinter.CTkFrame(master=self,
37-
corner_radius=10)
38-
self.frame_right.grid(row=0, column=1, rowspan=1, pady=20, padx=20, sticky="nsew")
38+
self.frame_right = customtkinter.CTkFrame(master=self, corner_radius=0, fg_color=self.fg_color)
39+
self.frame_right.grid(row=0, column=1, rowspan=1, pady=0, padx=0, sticky="nsew")
3940

4041
# ============ frame_left ============
4142

42-
self.frame_left.grid_rowconfigure(0, minsize=10)
43-
4443
self.button_1 = customtkinter.CTkButton(master=self.frame_left,
4544
text="Set Marker",
4645
command=self.set_marker_event,
4746
width=120, height=30,
4847
border_width=0,
4948
corner_radius=8)
50-
self.button_1.grid(pady=10, padx=20, row=3, column=0)
49+
self.button_1.grid(pady=(20, 0), padx=(20, 20), row=0, column=0)
5150

5251
self.button_2 = customtkinter.CTkButton(master=self.frame_left,
5352
text="Clear Markers",
5453
command=self.clear_marker_event,
5554
width=120, height=30,
5655
border_width=0,
5756
corner_radius=8)
58-
self.button_2.grid(pady=10, padx=20, row=4, column=0)
57+
self.button_2.grid(pady=(20, 0), padx=(20, 20), row=1, column=0)
5958

6059
# ============ frame_right ============
6160

@@ -65,16 +64,16 @@ def __init__(self, *args, **kwargs):
6564
self.frame_right.grid_columnconfigure(1, weight=0)
6665
self.frame_right.grid_columnconfigure(2, weight=1)
6766

68-
self.map_widget = TkinterMapView(self.frame_right, width=450, height=250, corner_radius=9)
69-
self.map_widget.grid(row=0, rowspan=1, column=0, columnspan=3, sticky="nswe", padx=20, pady=20)
67+
self.map_widget = TkinterMapView(self.frame_right, corner_radius=11)
68+
self.map_widget.grid(row=0, rowspan=1, column=0, columnspan=3, sticky="nswe", padx=(20, 20), pady=(20, 0))
7069
self.map_widget.set_address("Berlin")
7170

7271
self.entry = customtkinter.CTkEntry(master=self.frame_right,
7372
placeholder_text="type address",
7473
width=140,
7574
height=30,
7675
corner_radius=8)
77-
self.entry.grid(row=1, column=0, sticky="we", padx=20, pady=20)
76+
self.entry.grid(row=1, column=0, sticky="we", padx=(20, 0), pady=20)
7877
self.entry.entry.bind("<Return>", self.search_event)
7978

8079
self.button_5 = customtkinter.CTkButton(master=self.frame_right,
@@ -83,7 +82,7 @@ def __init__(self, *args, **kwargs):
8382
command=self.search_event,
8483
border_width=0,
8584
corner_radius=8)
86-
self.button_5.grid(row=1, column=1, sticky="w", padx=10, pady=20)
85+
self.button_5.grid(row=1, column=1, sticky="w", padx=(20, 0), pady=20)
8786

8887
self.slider_1 = customtkinter.CTkSlider(master=self.frame_right,
8988
width=200,

0 commit comments

Comments
 (0)