borderless, bind the mouse and drag the window ,How to solve the problem of dragging window remnants #2603
Unanswered
maxwangwyf
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
from hPyT import *
def start_move(event):
global x_offset, y_offset
x_offset = event.x
y_offset = event.y
def stop_move(event):
global x_offset, y_offset
x_offset = None
y_offset = None
def on_drag(event):
global x_offset, y_offset
if x_offset is not None and y_offset is not None:
app.geometry(f"+{event.x_root - x_offset}+{event.y_root - y_offset}")
app = ctk.CTk()
title_bar.hide(app)#无边框且保留任务栏
app.bind('', start_move)#标题栏拖动效果
app.bind('', on_drag)
app.bind('', stop_move)
app.mainloop()
Beta Was this translation helpful? Give feedback.
All reactions