How do I paste HTML to the clipboard so that it is recognized as HTML in applications such as Open Office and MS Word? It is possible when using gtkhtml or gecko if you've already rendered it, but I need a straight GTK+ solution.
相关问题
- Markdown to clipboard as rich text
- Need a way to load image file into Mac clipboard u
- Overriding virtual methods in PyGObject
- how to (programmatically) scroll to a specific lin
- How do I really make a GTK+ 3 GtkLayout transparen
相关文章
- How to add clipboard support to Matplotlib figures
- Converting PIL Image to GTK Pixbuf
- Can you get the parent GTK window from a widget?
- How to set multiple items into a GtkSelection for
- Getting selected item in active window
- Stacking widgets in Gtk+
- How to access the theming Fonts and Colors on GTK/
- When are GTK signals emitted
You call
gtk_clipboard_set_with_data
orgtk_clipboard_set_with_owner
, passing aGtkTargetEntry
with"text/html"
as the value for thetarget
field.It's good practice to also provide
"UTF8_STRING"
and"STRING"
targets for applications that don't support HTML.Here's an example of some code that does this: GEdit HTML clipboard plugin.