aboutsummaryrefslogtreecommitdiffstats
path: root/examples/pugl_clipboard_demo.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/pugl_clipboard_demo.c')
-rw-r--r--examples/pugl_clipboard_demo.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/examples/pugl_clipboard_demo.c b/examples/pugl_clipboard_demo.c
index 08227d1..01e96dc 100644
--- a/examples/pugl_clipboard_demo.c
+++ b/examples/pugl_clipboard_demo.c
@@ -81,10 +81,10 @@ static void
onDataOffer(PuglView* view, const PuglDataOfferEvent* event)
{
const PuglClipboard clipboard = event->clipboard;
- const uint32_t numTypes = puglGetNumClipboardTypes(view, clipboard);
+ const size_t numTypes = puglGetNumClipboardTypes(view, clipboard);
// Print all offered types to be useful as a testing program
- fprintf(stderr, "Offered %u types:\n", numTypes);
+ fprintf(stderr, "Offered %zu types:\n", numTypes);
for (uint32_t t = 0; t < numTypes; ++t) {
const char* type = puglGetClipboardType(view, clipboard, t);
fprintf(stderr, "\t%s\n", type);
@@ -230,12 +230,16 @@ main(int argc, char** argv)
puglSetSizeHint(view, PUGL_MIN_SIZE, 128, 128);
puglSetBackend(view, puglGlBackend());
+ puglRegisterDragType(view, "text/plain");
+ puglRegisterDragType(view, "text/uri-list");
+
puglSetViewHint(view, PUGL_CONTEXT_DEBUG, opts.errorChecking);
puglSetViewHint(view, PUGL_RESIZABLE, opts.resizable);
puglSetViewHint(view, PUGL_SAMPLES, opts.samples);
puglSetViewHint(view, PUGL_DOUBLE_BUFFER, opts.doubleBuffer);
puglSetViewHint(view, PUGL_SWAP_INTERVAL, opts.sync);
puglSetViewHint(view, PUGL_IGNORE_KEY_REPEAT, opts.ignoreKeyRepeat);
+ puglSetViewHint(view, PUGL_ACCEPT_DROP, true);
puglSetHandle(view, &app.cube);
puglSetEventFunc(view, onEvent);