Pyloid Docs
GithubLanguage
  • 💎What is Pyloid?
  • Getting Started
    • Prerequisites
    • Create Pyloid App
  • Core Concepts
    • Thread Safety
  • API
    • Python (Backend)
      • Pyloid
      • BrowserWindow
      • Monitor
      • TrayEvent
      • Utility Functions
      • RPC
      • Store
    • Javascript (Frontend)
      • Event
      • BaseAPI
      • RPC
  • Guides
    • Load Webview
    • Serve Frontend
    • Calling Python from JS
    • Calling JS from Python
    • Keyboard Shotcuts
    • Notification
    • Tray
    • Timer
    • File Watcher
    • Clipboard
    • Window Position
    • Devtools
    • Window Drag Region
    • Window Radius And Transparent
    • Autostart
    • Production Utils
    • Desktop Monitor
    • File Dialog
    • Splash Screen
Powered by GitBook
On this page
  • Basic Setup
  • Example Usage

Was this helpful?

Edit on GitHub
  1. Guides

Window Drag Region

By using the data-pyloid-drag-region attribute, you can make HTML elements draggable. Below is a description of how to customize the window title bar using this attribute.

Basic Setup

First, when creating a window in main.py, pass the frame=False argument to remove the default frame.

window = app.create_window(title="Draggable Region", frame=False)

In the HTML document, add the data-pyloid-drag-region attribute to the element you want to make draggable. For example, you can add this attribute to a div element as follows:

<div data-pyloid-drag-region>Draggable Area</div>

Example Usage

Below is an example of an HTML document that includes a draggable area using the data-pyloid-drag-region attribute:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Draggable Region</title>
  </head>
  <body>
    <div data-pyloid-drag-region>Draggable Area</div>
    <h1>Hello</h1>
  </body>
</html>

By using the data-pyloid-drag-region attribute in this way, you can set the desired elements as draggable areas. This allows you to freely customize the window title bar.

PreviousDevtoolsNextWindow Radius And Transparent

Last updated 25 days ago

Was this helpful?