Re: Gtk3 and drag'n'drop



On 24/02/18 13:16, Emmanuele Bassi wrote:
The issue is that the GTK drag and drop API lives in the GTK
namespace, but operates on a GdkDragContext object under the GDK
namespace. This is not allowed with introspection-based bindings,
because the method cannot be reconciled with the object.

Of course, this is perfectly valid at the C level, because there are
only functions. Which means that the gtk_drag_* API has to be treated
as functions, e.g.:

  Gtk3::drag_finish($context, $delete, time);

The old Gtk2 bindings would "cheat", and move the API under the
GdkDragContext namespace, hence the change.

Thanks for this. That seems to work. Now I am looking for the Gtk3
equivalent of $context->get_targets as per:

    $self->signal_connect(
        drag_drop => sub {
            my ( $tree, $context, $x, $y, $when ) = @_;
            if ( my $targ = $context->get_targets ) {
                $tree->drag_get_data( $context, $targ, $when );
                return TRUE;
            }
            return FALSE;
        }
    );

I've tried variations on Gtk3::drag_dest_get_target_list() but I can't
find the right one.

Any ideas?

Regards

Jeff

Attachment: signature.asc
Description: OpenPGP digital signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]