Adding signals dynamically



Hi all,

I have the following lines inside a loop in a callback function:

               CC_GLBL->host_files = gtk_menu_item_new_with_label
(_(label));
               gtk_menu_append (GTK_MENU
(CC_GLBL->host_file_name_a_menu), CC_GLBL->host_files);
               gtk_widget_show (CC_GLBL->host_files);
               gtk_signal_connect (GTK_OBJECT (CC_GLBL->host_files),
"activate", GTK_SIGNAL_FUNC (edit_this_file),  label);

This is part of a routine that scans the contents of a directory and
appends the file names into a menu. I am trying to attach a signal to
each menu item so that when the user selects the menu item the function
edit_this_file gets called and opens that specific menu item. Does
anyone have any idea if this will actually be possible? i.e create
signals dianamically and how can the signal get the right menu item
passed to the callback.

Thanks.

--
Marco Quezada
Aerospaceo Engineero
NLX Corporation
22626 Sally Ride Dr.
Sterling, VA, 20164
703-234-2100 x1028







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