return -1;
selected = -2;
int dlg_listbox_index(union control *ctrl, void *dlg){    struct dlgparam *dp = (struct dlgparam *)dlg;    struct uctrl *uc = dlg_find_byctrl(dp, ctrl);    GList *children;    GtkWidget *item, *activeitem;    int i;    int selected = -1;    assert(uc->ctrl->generic.type == CTRL_EDITBOX ||	   uc->ctrl->generic.type == CTRL_LISTBOX);    assert(uc->menu != NULL || uc->list != NULL);    if (uc->menu)	activeitem = gtk_menu_get_active(GTK_MENU(uc->menu));    children = gtk_container_children(GTK_CONTAINER(uc->menu ? uc->menu :						    uc->list));    for (i = 0; children!=NULL && (item = GTK_WIDGET(children->data))!=NULL;	 i++, children = children->next) {	if (uc->menu ? activeitem == item :	    GTK_WIDGET_STATE(item) == GTK_STATE_SELECTED) {	    if (selected < 0)		selected = i;	    else		return -1;	}    }    return selected;}