forked from Leak_Technologies/VideoTools
Fix TargetEntryNew return handling
This commit is contained in:
parent
4d33e1ec71
commit
93bd8a1424
|
|
@ -268,8 +268,9 @@ func preferDark() {
|
|||
|
||||
func setupDragDest(p *pane, win *gtk.Window) {
|
||||
// Accept URI drops
|
||||
target := gtk.TargetEntryNew("text/uri-list", gtk.TARGET_OTHER_APP, 0)
|
||||
p.area.DragDestSet(gtk.DEST_DEFAULT_ALL, []gtk.TargetEntry{*target}, gdk.ACTION_COPY)
|
||||
if target, err := gtk.TargetEntryNew("text/uri-list", gtk.TARGET_OTHER_APP, 0); err == nil {
|
||||
p.area.DragDestSet(gtk.DEST_DEFAULT_ALL, []gtk.TargetEntry{*target}, gdk.ACTION_COPY)
|
||||
}
|
||||
p.area.Connect("drag-data-received", func(_ *gtk.DrawingArea, ctx *gdk.DragContext, x, y int, data *gtk.SelectionData, info uint, t uint32) {
|
||||
uris := data.GetURIs()
|
||||
if len(uris) == 0 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user