Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Enhancement] Simple drag and drop support

オープン
#6,051 コメント 10 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
desktop, frontend

調査の方向性

まず、tkinterポートにおけるWindowの作成とwindow.read()のイベントおよび値の流れを追跡し、その後、Qt InputおよびMultiline要素について説明されている既存のドラッグ&ドロップ対応と比較します。ドロップされたファイルとプレーンテキストをどのように表現するかを定義し、要求されたデスクトップポートに対してウィンドウ全体での対応を実装し、ドロップによって利用可能なイベントと値が生成されることを検証します。

索引モデルが issue の本文から書いたものです。

説明

enhancement

Type of Issue (Enhancement, Error, Bug, Question)

Enhancement


Environment

Operating System

Windows version 10 21H2

PySimpleGUI Port (tkinter, Qt, Wx, Web)

tkinter, Qt, Wx


Versions

Python version (sg.sys.version)

3.10.8 (tags/v3.10.8:aaaf517, Oct 11 2022, 16:50:30) [MSC v.1933 64 bit (AMD64)]

PySimpleGUI Version (sg.__version__)

4.60.4

GUI Version (tkinter (sg.tclversion_detailed), PySide2, WxPython, Remi)

8.6.12



Troubleshooting

These items may solve your problem. Please check those you've done by changing - [ ] to - [X]

  • Searched main docs for your problem www.PySimpleGUI.org
  • Looked for Demo Programs that are similar to your goal Demos.PySimpleGUI.org
  • If not tkinter - looked for Demo Programs for specific port
  • For non tkinter - Looked at readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
  • Run your program outside of your debugger (from a command line)
  • Searched through Issues (open and closed) to see if already reported Issues.PySimpleGUI.org
  • Tried using the PySimpleGUI.py file on GitHub. Your problem may have already been fixed but not released

Detailed Description

In short, make it possible to drop file(s) and plain text (which includes urls from browser address bar) into a Window.

In both Windows and Mac, drag and drop is one of the first things that the users learn, it is easy and intuitive. Depriving an app of ability to implement drag and drop is crippling it. It's no better than, say, disabling right mouse clicks.

Currently, PySimpleGUI provides a very limited drag and drop support.
According to https://github.com/PySimpleGUI/PySimpleGUI/issues/732 and https://github.com/PySimpleGUI/PySimpleGUI/issues/6047, it's only Qt port (which is still in Alpha since 2020) and only Input and Multiline elements. Such limitations lead to questionable layout choices, and it's kind of awkward asking users to "aim for that little text input thingy" too.

So here's how I imagine the solution. Something very basic and easy to use, e.g.

Create a Window with enable_drag_and_drop_events property set to True.

After that, dropping a file or text anywhere into a Window would generate an event, and event, values = window.read() would return something like DND:<plain text or path plus file name> as event or maybe just DND for event and a special key-value pair in values for the actual data.

Any desktop port will do, but tkinter is preferable since it's more complete and doesn't seem outdated like Qt and Wx versions.

主要言語
Python
スター
13.8k
フォーク
1.8k
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

PySimpleGUI/PySimpleGUI のほかの issue

PySimpleGUI/PySimpleGUI の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。