MATE drag-and-drop development SOLVED

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
CliveMcCarthy
Level 3
Level 3
Posts: 156
Joined: Mon Jul 29, 2013 1:05 pm
Location: San Francisco
Contact:

MATE drag-and-drop development SOLVED

Post by CliveMcCarthy »

I'm trying t build a MATE (Gnome) based application for Mint 20.2 with MATE 1.24.0 I have previously built a couple of GTK+ applications but now want to use drag-and-drop from Caja to my new application and I need a connection to MATE to do this. What and where are the headers and libraries to do this ?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
First program written in Algol for a KDF9 (just look up KDF9 on Wikipedia).
User avatar
spamegg
Level 14
Level 14
Posts: 5096
Joined: Mon Oct 28, 2019 2:34 am
Contact:

Re: MATE drag-and-drop development

Post by spamegg »

You might want to start looking here: https://github.com/mate-desktop
CliveMcCarthy
Level 3
Level 3
Posts: 156
Joined: Mon Jul 29, 2013 1:05 pm
Location: San Francisco
Contact:

Re: MATE drag-and-drop development

Post by CliveMcCarthy »

Thanks. A good start. I found the headers that look promising:

Code: Select all

#include <glib-object.h>
#include <glib/gi18n.h>
#include <gio/gio.h>
#include <gtk/gtk.h>
Now I have to search for the MATE libs and start looking for drag-and-drop code...
First program written in Algol for a KDF9 (just look up KDF9 on Wikipedia).
CliveMcCarthy
Level 3
Level 3
Posts: 156
Joined: Mon Jul 29, 2013 1:05 pm
Location: San Francisco
Contact:

Re: MATE drag-and-drop development

Post by CliveMcCarthy »

First program written in Algol for a KDF9 (just look up KDF9 on Wikipedia).
CliveMcCarthy
Level 3
Level 3
Posts: 156
Joined: Mon Jul 29, 2013 1:05 pm
Location: San Francisco
Contact:

Re: MATE drag-and-drop development

Post by CliveMcCarthy »

After poking around in configure.ac it seems that libmate-desktop-dev is needed. This lead me to install it. I then guessed that libmate-desktop.a would need to be linked into my code. I didn't even know if such a lib existed. It does ! I got lucky.

There seems to be a paucity of novice Mate development resources and old Gnome code doesn't help.
First program written in Algol for a KDF9 (just look up KDF9 on Wikipedia).
CliveMcCarthy
Level 3
Level 3
Posts: 156
Joined: Mon Jul 29, 2013 1:05 pm
Location: San Francisco
Contact:

Re: MATE drag-and-drop development SOLVED

Post by CliveMcCarthy »

Scratch all that...

After poking around I discovered I didn't need any additional libraries. The hook-up for the drag-and-drop wasn't hard and I can drag images from Caja to my application nicely... It just wasn't clear to me that the Mate desktop, forked from Gnome, has the existing Gtk+ interfaces.

Code: Select all

	for(k = 0; k < 10; k++)
	{
		g_signal_connect			// now in Glib not GTK
		(
			image_strip[k],
			"drag_data_received",
			G_CALLBACK(drag_image_received),
			NULL
		);
	}

//---------------- final setup for drop destination

	for(k = 0; k < 10; k++)
	{
		gtk_drag_dest_set
		(
			GTK_WIDGET(image_strip[k]),
			GTK_DEST_DEFAULT_ALL,
			target_table,
			G_N_ELEMENTS(target_table),
			GDK_ACTION_COPY
		);
	}
First program written in Algol for a KDF9 (just look up KDF9 on Wikipedia).
Locked

Return to “Software & Applications”