Re: How can I access gtk_tree_view declared in interface.c from callback.c ?

2005-05-19 Thread Gyözö Both
you have to do a

GtkTreeView *treeview1 = GTK_TREE_VIEW(lookup_widget("treeview1", 
GTK_WIDGET(menuitem)));

before you can use the treeview. as far as i know (i might be wrong) in the 
newer glade versions one cannot use the 'user_data' stuff in the callback 
functions.

the widgets aren't declared in the callback file, you have to look them up 
using a widget from the same window and 'lookup_widget' before you can use 
them.

gyözö

> Hi,
>
> I have a file interface.c where glade set up a gtk treeview named
> treeview1. When in callbacks.c I try to use treeview1 I got this error:
>
> callbacks.c: In function `on_new1_activate':
> callbacks.c:56: warning: dereferencing `void *' pointer
> callbacks.c:56: error: request for member `treeview1' in something not a
> structure or union
>
> This is the code:
> void on_new1_activate (GtkMenuItem *menuitem, gpointer user_data)
> {
>   //qui devo creare un nuovo archivio.
>   gchar *path = Show_File_Dialog ( FALSE );
>   if (path == NULL) return;
>   g_print ("Hai scelto: %s\n",path);
>   switch (ChoosenArchiveType)
>   {
>   case 0:
>   g_print ("Hai scelto: bzip2\n");
>   break;
>   case 1:
>   g_print ("Hai scelto: rar\n");
>   break;
>   case 2:
>   g_print ("Hai scelto: tar\n");
>   break;
>   case 3:
>   g_print ("Hai scelto: zip\n");
>   break;
>   default:
>   break;
>   }
>   g_free (path);
> 56:   user_data->treeview1 = NULL;<- here I got the error
> }
>
> Thanks for the attention,

-- 
Ginsberg's Theorem:
(1) You can't win.
(2) You can't break even.
(3) You can't even quit the game.

Freeman's Commentary on Ginsberg's theorem:
Every major philosophy that attempts to make life seem
meaningful is based on the negation of one part of Ginsberg's
Theorem.  To wit:

(1) Capitalism is based on the assumption that you can win.
(2) Socialism is based on the assumption that you can break
even.
(3) Mysticism is based on the assumption that you can quit the
game.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: How can I access gtk_tree_view declared in interface.c from callback.c ?

2005-05-19 Thread André Pedralho
I don't know if it will work, but you may try to use a pointer for
user_data like:
void on_new1_activate (GtkMenuItem *menuitem, gpointer *user_data)
then you can access an internal structure of this...



On 5/19/05, R.Rajaram <[EMAIL PROTECTED]> wrote:
> Have a look at "lookup_widget" in support.c. Hope it helps
> 
> 
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Colossus
> Sent: Thursday, May 19, 2005 4:36 PM
> To: gtk-app-devel-list@gnome.org
> Subject: How can I access gtk_tree_view declared in interface.c from
> callback.c ?
> 
> 
> Hi,
> 
> I have a file interface.c where glade set up a gtk treeview named
> treeview1. When in callbacks.c I try to use treeview1 I got this error:
> 
> callbacks.c: In function `on_new1_activate':
> callbacks.c:56: warning: dereferencing `void *' pointer
> callbacks.c:56: error: request for member `treeview1' in something not a
> 
> structure or union
> 
> This is the code:
> void on_new1_activate (GtkMenuItem *menuitem, gpointer user_data) {
> //qui devo creare un nuovo archivio.
> gchar *path = Show_File_Dialog ( FALSE );
> if (path == NULL) return;
> g_print ("Hai scelto: %s\n",path);
> switch (ChoosenArchiveType)
> {
> case 0:
> g_print ("Hai scelto: bzip2\n");
> break;
> case 1:
> g_print ("Hai scelto: rar\n");
> break;
> case 2:
> g_print ("Hai scelto: tar\n");
> break;
> case 3:
> g_print ("Hai scelto: zip\n");
> break;
> default:
> break;
> }
> g_free (path);
> 56: user_data->treeview1 = NULL;<- here I got the error
> }
> 
> Thanks for the attention,
> --
> Colossus
> 
> Cpsed, a Linux OpenGL 3D scene editor http://cpsed.sourceforge.net/
> 
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> 
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> 


-- 
André Pedralho
Bachelor in Computer Science
Instituto Nokia de Tecnologia
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


RE: How can I access gtk_tree_view declared in interface.c from callback.c ?

2005-05-19 Thread R.Rajaram
Have a look at "lookup_widget" in support.c. Hope it helps




-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Colossus
Sent: Thursday, May 19, 2005 4:36 PM
To: gtk-app-devel-list@gnome.org
Subject: How can I access gtk_tree_view declared in interface.c from
callback.c ?


Hi,

I have a file interface.c where glade set up a gtk treeview named 
treeview1. When in callbacks.c I try to use treeview1 I got this error:

callbacks.c: In function `on_new1_activate':
callbacks.c:56: warning: dereferencing `void *' pointer
callbacks.c:56: error: request for member `treeview1' in something not a

structure or union

This is the code:
void on_new1_activate (GtkMenuItem *menuitem, gpointer user_data) {
//qui devo creare un nuovo archivio.
gchar *path = Show_File_Dialog ( FALSE );
if (path == NULL) return;
g_print ("Hai scelto: %s\n",path);
switch (ChoosenArchiveType)
{
case 0:
g_print ("Hai scelto: bzip2\n");
break;
case 1:
g_print ("Hai scelto: rar\n");
break;
case 2:
g_print ("Hai scelto: tar\n");
break;
case 3:
g_print ("Hai scelto: zip\n");
break;
default:
break;
}
g_free (path);
56: user_data->treeview1 = NULL;<- here I got the error
}

Thanks for the attention,
-- 
Colossus

Cpsed, a Linux OpenGL 3D scene editor http://cpsed.sourceforge.net/

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


How can I access gtk_tree_view declared in interface.c from callback.c ?

2005-05-19 Thread Colossus
Hi,
I have a file interface.c where glade set up a gtk treeview named 
treeview1. When in callbacks.c I try to use treeview1 I got this error:

callbacks.c: In function `on_new1_activate':
callbacks.c:56: warning: dereferencing `void *' pointer
callbacks.c:56: error: request for member `treeview1' in something not a 
structure or union

This is the code:
void on_new1_activate (GtkMenuItem *menuitem, gpointer user_data)
{
//qui devo creare un nuovo archivio.
gchar *path = Show_File_Dialog ( FALSE );
if (path == NULL) return;
g_print ("Hai scelto: %s\n",path);
switch (ChoosenArchiveType)
{
case 0:
g_print ("Hai scelto: bzip2\n");
break;
case 1:
g_print ("Hai scelto: rar\n");
break;
case 2:
g_print ("Hai scelto: tar\n");
break;
case 3:
g_print ("Hai scelto: zip\n");
break;
default:
break;
}
g_free (path);
56: user_data->treeview1 = NULL; <- here I got the error
}
Thanks for the attention,
--
Colossus
Cpsed, a Linux OpenGL 3D scene editor
http://cpsed.sourceforge.net/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list