include example of how to get the required TargetEntry for drag and drop
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 42/100
- Issue 類型
- 文件
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- python
研究方向
從目前的拖放教學開始,將其對放置操作的處理方式與提供的 pygtk 教學範例進行比較。檢查教學如何說明接受來自其他應用程式的拖曳以及建立 TargetEntries;完成標準是其中包含一個可正常運作的 PyGObject 範例,或涵蓋這兩點的等效指引。
由索引模型根據 Issue 內容生成。
描述
I wanted to build an app which accepts drags. I looked up the drag and drop tutorial but it wasn't clear to me how I would make my app accept drags from other applications. Also, I needed to produce the necessary TargetEntries which I didn't know how to do.
The following example is ported from the pygtk tutorial but uses pygi. Maybe it's possible to include that somehow in the current tutorial.
#!/usr/bin/env python
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk
def motion_cb(wid, context, x, y, time):
Gdk.drag_status(context, Gdk.DragAction.COPY, time)
return True
def drop_cb(wid, context, x, y, time):
l.set_text('\n'.join([str(t) for t in context.list_targets()]))
context.finish(True, False, time)
return True
w = Gtk.Window()
w.set_size_request(200, 150)
w.drag_dest_set(0, [], 0)
w.connect('drag-motion', motion_cb)
w.connect('drag-drop', drop_cb)
w.connect('destroy', lambda w: Gtk.main_quit())
l = Gtk.Label()
w.add(l)
w.show_all()
Gtk.main()
- 主要語言
- Python
- 星號
- 392
- 分支
- 157
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
sebp/PyGObject-Tutorial 的其他 Issue
-
難度 5/5 一週以上 新手友好度 20/100
sebp/PyGObject-Tutorial#229 ·
-
難度 3/5 1-2 天 新手友好度 35/100
sebp/PyGObject-Tutorial#219 ·
-
難度 2/5 1-3 小時 新手友好度 45/100
sebp/PyGObject-Tutorial#218 ·
-
難度 4/5 3-5 天 新手友好度 35/100
sebp/PyGObject-Tutorial#214 ·
-
難度 2/5 1-3 小時 新手友好度 52/100
sebp/PyGObject-Tutorial#210 ·
查看 sebp/PyGObject-Tutorial 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 86/100
zostera/django-bootstrap4#894 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
use-agent-os/agent-os#3276 ·
-
難度 2/5 1-3 小時 新手友好度 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
難度 2/5 1-3 小時 新手友好度 88/100
NousResearch/hermes-agent#117848 ·
-
難度 2/5 1-3 小時 新手友好度 82/100
zilliztech/memsearch#759 ·