GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Sep 23, 2014 10:22 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Text drag-n-drop does not work correctly on Windows
PostPosted: Wed Jan 30, 2013 12:21 pm 
Offline
GTK+ Guru

Joined: Tue Feb 05, 2008 8:39 am
Posts: 130
Hello, everybody!
I'm developing cross-plartform GTK+ application with GtkTextView. TextView has its own rich text format and is created this way:
Code:
  buffer = gtk_text_buffer_new(tag_table);
  input_str = gtk_text_view_new_with_buffer(buffer);
#if GTK_CHECK_VERSION(2,10,0)
  // called first
  gtk_text_buffer_register_deserialize_format(buffer, "HTML Format",
                                              htmlformat_deser, NULL, NULL);
  // called second
  gtk_text_buffer_register_deserialize_format(buffer, "text/html",
                                              texthtml_deser, NULL, NULL);
#endif
  g_object_unref(G_OBJECT(buffer));

#if GTK_CHECK_VERSION(2,6,0)
  gtk_drag_dest_add_uri_targets(input_str);
  gtk_drag_dest_add_text_targets(input_str);
  g_signal_connect(G_OBJECT(input_str), "drag-data-received", G_CALLBACK(input_rec), NULL);
#endif

In Linux with GTK+ 2 and with GTK+ 3 all works fine - when I drag and drop rich text from another applications (browsers, Libre Office Writer etc.) it's inserted and input_rec get invoked. When I copy and paste rich text from other application deserialization function get invoked.
But in MS Windows drag-n-frop works with URIs only, text cannot be droped to my TextView. Why? What do I do wrong?
By the way WinWord can receive droped text from Google Chrome. It's for example.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group