Re: GTK3 porting problem (clipboard)
- From: Jaroslav Šmíd <jardasmid gmail com>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: GTK3 porting problem (clipboard)
- Date: Thu, 10 Mar 2011 15:00:33 +0100
I don't know the answer, but this is "wrong":
int nTargetCnt = g_list_length (list->list);
g_list_length returns guint, not int. Although this is valid code
(implicit typecast), it can cause bad things.
On 03/10/2011 01:44 PM, Miroslav Rajcic wrote:
I resolved the majority of the the issues when porting my program from
GTK 2.x to GTK 3.x.
Unfortunately I still have one issue left:
when compiling the program on Feodra 15 alpha (gcc 4.6, GTK3 v3.0.2) I
get these errors:
./src/clipboard.cpp:442:38: error: invalid use of incomplete type
'GtkTargetList'
/usr/include/gtk-3.0/gtk/gtkselection.h:48:16: error: forward
declaration of 'GtkTargetList'
./src/clipboard.cpp:445:20: error: invalid use of incomplete type
'GtkTargetList'
/usr/include/gtk-3.0/gtk/gtkselection.h:48:16: error: forward
declaration of 'GtkTargetList'
./src/clipboard.cpp:447:3: error: 'GtkTargetPair' was not declared in
this scope
./src/clipboard.cpp:447:18: error: 'pair' was not declared in this scope
The relevant code is this:
#include <gtk/gtk.h>
GtkTargetList *list = gtk_target_list_new (NULL, 0);
.. add text and other targets in the list
// LINE 442: error: invalid use of incomplete type 'GtkTargetList'
int nTargetCnt = g_list_length (list->list);
//LINE 445: error: invalid use of incomplete type 'GtkTargetList'
for (GList *l=list->list; l; l=l->next, i++)
//LINE 447: error: 'GtkTargetPair' was not declared in this scope
GtkTargetPair *pair = (GtkTargetPair *)l->data;
This all works fine with GTK2.x.
What is the correct way to work with this on GTK 3.x ?
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]