file and dir lists in an other window?




I want to take the dir_list and file_list of the file selection widget and
add them to an other window. I've tried the following code but it doesn't
work. I can't seem to remove the 2 widgets from their parents to be able
to add them to my frame:


project_struct = gtk_file_selection_new("PROJECT STRUCT");

gtk_container_remove(GTK_CONTAINER(GTK_FILE_SELECTION(project_struct)->dir_list->parent),
GTK_WIDGET(GTK_FILE_SELECTION(project_struct)->dir_list));

gtk_container_remove(GTK_CONTAINER(GTK_FILE_SELECTION(project_struct)->file_list->parent),
GTK_WIDGET(GTK_FILE_SELECTION(project_struct)->file_list));

gtk_box_pack_start(GTK_BOX(vbox),
GTK_FILE_SELECTION(project_struct)->dir_list, TRUE, TRUE, 0);

gtk_box_pack_start(GTK_BOX(vbox),
GTK_FILE_SELECTION(project_struct)->file_list, TRUE, TRUE, 0);

gtk_signal_connect (GTK_OBJECT(GTK_FILE_SELECTION(project_struct)->file_list),
 "select_row", GTK_SIGNAL_FUNC(CB_project_click), project_struct);

gtk_widget_show(GTK_FILE_SELECTION(project_struct)->dir_list);
gtk_widget_show(GTK_FILE_SELECTION(project_struct)->file_list);


I get these errors:

Gtk-CRITICAL **: file gtkwidget.c: line 3300 (gtk_widget_set_parent):
assertion `GTK_IS_WIDGET (widget)' failed.

Gtk-WARNING **: invalid cast from `(unknown)' to `GtkObject'

Gtk-CRITICAL **: file gtkwidget.c: line 1642 (gtk_widget_realize):
assertion `GTK_IS_WIDGET (widget)' failed.

...





Patrick Lambert
-----------------------------------------------------------------------
DarkElf Network SysAdmin                         http://www.darkelf.net
CompSci Student University of Montreal          http://www.umontreal.ca
-----------------------------------------------------------------------
HTML emails and spam to this address will be sent directly to /dev/null



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]