Message-ID: <42F96DA8.7050003 at compiler.kaist.ac.kr> Date: Wed, 10 Aug 2005 11:59:52 +0900 From: SooHyoung Oh MIME-Version: 1.0 To: lablgtk mailing list Subject: Two question about selection Content-Type: multipart/alternative; boundary="------------090709000304000909090004" This is a multi-part message in MIME format. --------------090709000304000909090004 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I'm planning to update Lablgtk tutorial's "Manageing Selection" part as Gtk tutorial http://www.gtk.org/tutorial/ . I have two question about how to use "selection" in lablgtk? Can anyone help me? Q1) How to analysis "ATOM" in Lablgtk? In Gtk tutorial "17.2 Retrieving the selection", there is /* Signal handler called when the selections owner returns the data */ static void selection_received( GtkWidget *widget, GtkSelectionData *selection_data, gpointer data ) { ... /* Print out the atoms we received */ atoms = (GdkAtom *)selection_data->data; item_list = NULL; for (i = 0; i < selection_data->length / sizeof(GdkAtom); i++) { char *name; name = gdk_atom_name (atoms[i]); if (name != NULL) g_print ("%s\n",name); else g_print ("(bad atom)\n"); } Is there any way to make the selection_data->data to GdkAtom list in lablgtk? Q2) On "17.3 Supplying the selection", they uses "gtk_selection_owner_set". In lablgtk, we can do the same thing with "misc#grab_selection". Then how can we do job such as gtk_selection_owner_set(NULL, ...)? Do I have to implement "misc#ungrab_selection" or is there any method already implmented? --------------090709000304000909090004 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I'm planning to update Lablgtk tutorial's "Manageing Selection" part
as Gtk tutorial http://www.gtk.org/tutorial/ .
I have two question about how to use "selection" in lablgtk?
Can anyone help me?

Q1) How to analysis "ATOM" in Lablgtk?
In Gtk tutorial "17.2 Retrieving the selection", there is

/* Signal handler called when the selections owner returns the data */
static void selection_received( GtkWidget        *widget,
                                GtkSelectionData *selection_data, 
                                gpointer          data )
{
...
/* Print out the atoms we received */
  atoms = (GdkAtom *)selection_data->data;

  item_list = NULL;
  for (i = 0; i < selection_data->length / sizeof(GdkAtom); i++)
    {
      char *name;
      name = gdk_atom_name (atoms[i]);
      if (name != NULL)
	g_print ("%s\n",name);
      else
	g_print ("(bad atom)\n");
    }

Is there any way to make the selection_data->data to GdkAtom list in lablgtk?

Q2) On "17.3 Supplying the selection", they uses "gtk_selection_owner_set".
In lablgtk, we can do the same thing with "misc#grab_selection".
Then how can we do job such as gtk_selection_owner_set(NULL, ...)?
Do I have to implement "misc#ungrab_selection"
or is there any method already implmented?



--------------090709000304000909090004--