callback func problem



Hi
I wrote callback like this:

      void callback2menu (GtkWidget *widget)
{
        struct menu_itemz connect_to;
                void menuitem_response_tty(gchar *tty){
                        connect_to.device = tty;}
                void menuitem_response_speed(gchar *speed){
                        connect_to.speed = speed;}

        write_2_options(connect_to);
}

and use :

...
...   
        menu = gtk_menu_new();
        menu_item0 = gtk_menu_item_new_with_label ("   9600 bps   ");
        gtk_menu_append (GTK_MENU (menu), menu_item0);                                  
gtk_signal_connect_object (GTK_OBJECT (menu_item0), "activate",
                GTK_SIGNAL_FUNC (menuitem_response_speed), (gpointer) g_strdup("9600"));
        gtk_widget_show (menu_item0);

......
....
 menu = gtk_menu_new();
        tty_item0 = gtk_menu_item_new_with_label ("   /dev/ttyS0   ");
        gtk_menu_append (GTK_MENU (menu), tty_item0);
        gtk_signal_connect_object (GTK_OBJECT (tty_item0), "activate",                          
GTK_SIGNAL_FUNC (menuitem_response_tty), (gpointer) g_strdup("/dev/ttyS0"));
        gtk_widget_show (tty_item0);


.....


and gcc returns error for bad referance to funcion
How to save the problem?





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