Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7629909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:57:47+00:00 2026-05-31T05:57:47+00:00

The Evernote client has a nice feature that allows dragging links from Firefox into

  • 0

The Evernote client has a nice feature that allows dragging links from Firefox into the Evernote edit window, which works with both bookmarks and links in the browser window. I’d like to add a similar feature to a PyGTK application. Here is what I tried so far (using Py 2.7.2 and PyGTK 2.24.0):

import pygtk
pygtk.require('2.0')
import gtk,pango

flags = gtk.TARGET_OTHER_APP
targets = [
    ('text/uri-list', flags, 0),
    ('text/plain', flags, 1),
    ('text/x-uri', flags, 2),
    ('text/x-moz-url', flags, 3),
    ('application/x-bookmark', flags, 4),
    ('application/x-mswinurl', flags, 5),
    ('application/x-desktop', flags, 6)]

def receive_data(wid, context, x, y, data, info, time):
    type = data.type
    url = data.data
    if info == 2:
        url = url.decode('utf-16')
    url = url.splitlines()[0]
    text = '%s\n%s' % (type, url)
    label.set_text(text)
    context.finish(True, False, time)

window = gtk.Window()
window.set_size_request(400, 80)

label = gtk.Label()
label.set_justify(gtk.JUSTIFY_CENTER)
label.set_ellipsize(pango.ELLIPSIZE_END)
window.add(label)

window.drag_dest_set(gtk.DEST_DEFAULT_ALL, targets,
    gtk.gdk.ACTION_COPY|gtk.gdk.ACTION_MOVE)

window.connect('drag_data_received', receive_data)
window.connect('destroy', lambda window: gtk.main_quit())

window.show_all()
gtk.main()

This works nicely under Linux: You can drag and drop a link or bookmark from Firefox to the GTK window and it displays the dragged URL. Unfortuntately, it does not work under Windows. I have tested with Windows 7. Here, the above application only accepts file links, but not Internet links from Firefox or other web browsers. Is it possible to make it work under Windows, too?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:57:48+00:00Added an answer on May 31, 2026 at 5:57 am

    I’ve never seen inter-app GTK+ DnD work in Windows other than for dragging from Windows Explorer to a GTK+ app. You can test this using the drag targets demo from the PyGTK tutorial. (Even dragging from Explorer has some odd quirks, e.g. not triggering drag-motion.)

    I think it’s just either very buggy or not implemented.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm interested in connecting to the Evernote Service API, which uses Thrift, from a
i have a note which can share it to evernote,i done it sucessfully.but there
I have integrated evernote in my application by downloading sample code from its site.
How can I use the Evernote search grammer to get notes that were created
I have a bunch of notes in Evernote which I would like to access
I'm integrating a button that will launch the Evernote Bookmarklet in my project. The
i am having an application which can share Notes to evernote,it works fine i
I have come across Evernote's bookmarklet and was wondering how this worked. You can
I'm building a small app to send my 2do list stuff to Evernote over
Is it safe to write data to an NSPasteboard object from a background thread?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.