Zen
Zen

Reputation: 23

How to make frameless window draggable in pywebview?

I've been using pywebview lately to develop desktop applications with Flask. I wanted to use the frameless window feature and create my own title bar but the problem is I have no idea how I would go about making that frameless window draggable.

The documentation says it can be moved around by dragging any point but that is not the case for me.

Any ideas?

Upvotes: 2

Views: 1812

Answers (2)

Game Hack
Game Hack

Reputation: 1

Drag area

pywebview window can be moved by dragging any element with the pywebview-drag-region class name. This is useful, for example, in frameless mode when you would like to implement a custom caption bar. The magic class name can be overriden by re-assigning the webview.DRAG_REGION_SELECTOR constant.

Upvotes: 0

MusiPyCoder
MusiPyCoder

Reputation: 11

Use the class pywebview-drag-region in the element you want the window to get dragged from.

enter image description here

Upvotes: 0

Related Questions