difference between g_signal
- From: "Jerome Le Saux" <sidcpc gmail com>
- To: gtk-app-devel-list gnome org
- Subject: difference between g_signal
- Date: Fri, 24 Mar 2006 17:18:21 +0100
Hi all,
for a personnal project, I created a GUI in GTK+ without problem.
With all tutorials which exist on the net, it is not a real problem.
I would like to "plug" some g_signal from the interface to some functions in
standard C language.
the better way is to show you an example
// in my main function
....
GtkWidget* DirList, ....
// my button
pMenuItem = gtk_menu_item_new_with_label(OPENDK);
g_signal_connect_swapped(G_OBJECT(pMenuItem), "activate",
G_CALLBACK(OnOpenDkFile), DirList);
gtk_menu_shell_append(GTK_MENU_SHELL(pMenu), pMenuItem);
....
// my frame where I would to display my DirList widget
scrolled_window=gtk_scrolled_window_new(NULL, NULL);
gtk_container_add(GTK_CONTAINER(pVbox), scrolled_window);
DirList = gtk_clist_new_with_titles (3, DirTitles);
g_signal_connect (G_OBJECT (DirList), "select_row", NULL, NULL);
gtk_container_add (GTK_CONTAINER (scrolled_window), DirList);
.....
// and my function OnOpenDkFile
int OnOpenDkFile( gpointer data)
{
char file[64][14];
...
// I open a dialog box to set the file to be selected
....
for (i=0;i<64,i++)
{
strcpy(file[i],"totot");
}
gtk_clist_append(data,file);
}
and no problem during the compilation, but, either I obtain a seg fault when
I try to add file in the data gpointer, or GTK return me that it can't
append into cllist . etc
How can I add element to the list.
And how the list can be displayed into the scrolled window ?
Thank you for your answer.
Jerome
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]