Beispiel #1
0
static void
layer_dialog_delete_callback(GtkWidget *widget, gpointer gdata)
{
  Diagram *dia;
  GtkWidget *selected;
  Layer *layer;
  int pos;

  dia = layer_dialog->diagram;

  if ((dia != NULL) && (dia->data->layers->len>1)) {
    assert(GTK_LIST(layer_dialog->layer_list)->selection != NULL);
    selected = GTK_LIST(layer_dialog->layer_list)->selection->data;

    layer = dia->data->active_layer;

    data_remove_layer(dia->data, layer);
    diagram_add_update_all(dia);
    diagram_flush(dia);
    
    pos = gtk_list_child_position(GTK_LIST(layer_dialog->layer_list), selected);
    gtk_container_remove(GTK_CONTAINER(layer_dialog->layer_list), selected);

    undo_layer(dia, layer, TYPE_DELETE_LAYER,
	       dia->data->layers->len - pos);
    undo_set_transactionpoint(dia->undo);

    if (--pos<0)
      pos = 0;

    gtk_list_select_item(GTK_LIST(layer_dialog->layer_list), pos);
  }
}
Beispiel #2
0
void wxComboBox::SetSelection( int n )
{
    wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );

    DisableEvents();

    GtkWidget *list = GTK_COMBO(m_widget)->list;
    gtk_list_unselect_item( GTK_LIST(list), m_prevSelection );
    gtk_list_select_item( GTK_LIST(list), n );
    m_prevSelection = n;

    EnableEvents();
}
Beispiel #3
0
/* Selects the child number item of the list. Nothing happens if item
 * is out of bounds. The signal GtkList::select-child will be emitted. */
int
clip_GTK_LISTSELECTITEM(ClipMachine * ClipMachineMemory)
{
   C_widget *clst = _fetch_cw_arg(ClipMachineMemory);

   gint      item = INT_OPTION(ClipMachineMemory, 2, 1);

   CHECKCWID(clst, GTK_IS_LIST);
   CHECKOPT(2, NUMERIC_type_of_ClipVarType);
   gtk_list_select_item(GTK_LIST(clst->widget), item - 1);
   return 0;
 err:
   return 1;
}
Beispiel #4
0
static void
listprop_reset_widget(ListProperty *prop, WIDGET *widget)
{
  guint i;
  GList *items = NULL;
  gtk_list_clear_items(GTK_LIST(widget),0,-1);

  for (i = 0; i < prop->lines->len; i++) {
    items = g_list_append(items, make_item(g_ptr_array_index(prop->lines,i)));
  }
  gtk_list_append_items(GTK_LIST(widget),items);
  prop->w_selected = prop->selected;
  gtk_list_select_item(GTK_LIST(widget),prop->selected);
}
Beispiel #5
0
void wxListBox::DoSetSelection( int n, bool select )
{
    wxCHECK_RET( m_list != NULL, wxT("invalid listbox") );

    m_blockEvent = true;

    if (select)
    {
        if ((m_windowStyle & wxLB_SINGLE) != 0)
            gtk_list_unselect_item( m_list, m_prevSelection );
        gtk_list_select_item( m_list, n );
        m_prevSelection = n;
    }
    else
        gtk_list_unselect_item( m_list, n );

    m_blockEvent = false;
}
Beispiel #6
0
static void
layer_dialog_lower_callback(GtkWidget *widget, gpointer gdata)
{
  Layer *layer;
  Diagram *dia;
  GtkWidget *selected;
  GList *list = NULL;
  int pos;

  dia = layer_dialog->diagram;

  if ((dia != NULL) && (dia->data->layers->len>1)) {
    assert(GTK_LIST(layer_dialog->layer_list)->selection != NULL);
    selected = GTK_LIST(layer_dialog->layer_list)->selection->data;

    pos = gtk_list_child_position(GTK_LIST(layer_dialog->layer_list), selected);

    if (pos < dia->data->layers->len-1) {
      layer = DIA_LAYER_WIDGET(selected)->layer;
      data_lower_layer(dia->data, layer);
      
      list = g_list_prepend(list, selected);

      g_object_ref(selected);
      
      gtk_list_remove_items(GTK_LIST(layer_dialog->layer_list),
			    list);
      
      gtk_list_insert_items(GTK_LIST(layer_dialog->layer_list),
			    list, pos + 1);

      g_object_unref(selected);

      gtk_list_select_item(GTK_LIST(layer_dialog->layer_list), pos+1);
      
      diagram_add_update_all(dia);
      diagram_flush(dia);

      undo_layer(dia, layer, TYPE_LOWER_LAYER, 0);
      undo_set_transactionpoint(dia->undo);
    }

  }
}
Beispiel #7
0
void
layer_dialog_set_diagram(Diagram *dia)
{
  DiagramData *data;
  GtkWidget *layer_widget;
  Layer *layer;
  Layer *active_layer = NULL;
  int sel_pos;
  int i,j;

  if (dia!=NULL)
    active_layer = dia->data->active_layer;

  if (layer_dialog == NULL || layer_dialog->dialog == NULL) 
    layer_dialog_create(); /* May have been destroyed */
  g_assert(layer_dialog != NULL); /* must be valid now */

  gtk_container_foreach (GTK_CONTAINER(layer_dialog->layer_list),
                         _layer_widget_clear_layer, NULL);
  gtk_list_clear_items(GTK_LIST(layer_dialog->layer_list), 0, -1);
  layer_dialog->diagram = dia;
  if (dia != NULL) {
    i = g_list_index(dia_open_diagrams(), dia);
    if (i >= 0 && layer_dialog->diagram_omenu != NULL)
      gtk_option_menu_set_history(GTK_OPTION_MENU(layer_dialog->diagram_omenu),
				  i);
  }

  if (dia != NULL) {
    data = dia->data;

    sel_pos = 0;
    for (i=data->layers->len-1,j=0;i>=0;i--,j++) {
      layer = (Layer *) g_ptr_array_index(data->layers, i);
      layer_widget = dia_layer_widget_new(dia, layer);
      gtk_widget_show(layer_widget);
      gtk_container_add(GTK_CONTAINER(layer_dialog->layer_list), layer_widget);
      if (layer==active_layer)
	sel_pos = j;
    }
    gtk_list_select_item(GTK_LIST(layer_dialog->layer_list), sel_pos);
  }
}
Beispiel #8
0
static int
_combo_simple_entry_change(GtkEntry * entry, gpointer data)
{
   GtkCombo *cb = GTK_COMBO(data);

   int       i;

   i = _combo_simple_find_in_list(cb, gtk_entry_get_text(entry));

   if (i == -1)
      gtk_list_unselect_all(GTK_LIST(cb->list));
   else
    {
       gtk_signal_handler_block_by_func(GTK_OBJECT(cb->list), GSF(_combo_simple_list_select), data);
       gtk_list_select_item(GTK_LIST(cb->list), i);
       gtk_signal_handler_unblock_by_func(GTK_OBJECT(cb->list), GSF(_combo_simple_list_select), data);
    }
   return 0;
}
Beispiel #9
0
static gboolean
gail_combo_add_selection (AtkSelection   *selection,
                          gint           i)
{
  GtkCombo *combo;
  GtkWidget *widget;

  widget = GTK_ACCESSIBLE (selection)->widget;
  if (widget == NULL)
    /*
     * State is defunct
     */
    return FALSE;

  combo = GTK_COMBO (widget);

  gtk_list_select_item (GTK_LIST (combo->list), i);
  return TRUE;
}
Beispiel #10
0
static void
layer_dialog_new_callback(GtkWidget *widget, gpointer gdata)
{
  Layer *layer;
  Diagram *dia;
  GtkWidget *selected;
  GList *list = NULL;
  GtkWidget *layer_widget;
  int pos;
  static int next_layer_num = 1;

  dia = layer_dialog->diagram;

  if (dia != NULL) {
    gchar* new_layer_name = g_strdup_printf(_("New layer %d"),
					    next_layer_num++);
    layer = new_layer(new_layer_name, dia->data);

    assert(GTK_LIST(layer_dialog->layer_list)->selection != NULL);
    selected = GTK_LIST(layer_dialog->layer_list)->selection->data;
    pos = gtk_list_child_position(GTK_LIST(layer_dialog->layer_list), selected);

    data_add_layer_at(dia->data, layer, dia->data->layers->len - pos);
    
    diagram_add_update_all(dia);
    diagram_flush(dia);

    layer_widget = dia_layer_widget_new(dia, layer);
    gtk_widget_show(layer_widget);

    list = g_list_prepend(list, layer_widget);
    
    gtk_list_insert_items(GTK_LIST(layer_dialog->layer_list), list, pos);

    gtk_list_select_item(GTK_LIST(layer_dialog->layer_list), pos);

    undo_layer(dia, layer, TYPE_ADD_LAYER, dia->data->layers->len - pos);
    undo_set_transactionpoint(dia->undo);
  }
}
Beispiel #11
0
char
select_special_action (	PLUGIN_LIST	*plugin_list,
			char		*special_action_name,
			GtkList		*special_action_list )
/*
input:
	plugin_list		- List containing all available plugins
	special_action_name	- The name of the special action/plugin
	special_action_list	- A list (widget) containing all special actions/plugins
output:
	-
returns:
	TRUE if the plugin was found else FALSE.
description:
	This function changes the program_user (not the input variable) element of a key,
	in the key_settings list, to program_user (the input_variable). label_string is
	the name of a label (widget) which contains the name of the key to change. widget
	must be in the same tree as this label.
*/
{
	int count;
	PLUGIN *plugin;
	
	special_action_name++; /* Because the first character is a ';' */
	plugin = plugl_first_plugin(plugin_list);
	/* Find the matching plugin */
	for (count = 0; plugin && (strcmp(special_action_name, plugl_plugin_get_name(plugin)) != EQUAL); count++)
	{
		plugin = plugin->next;
	}

	if (plugin == NULL) /* If the plugin was not found */
	{
		return (FALSE);
	}
	/* Select the matching list item of special_action_list */
	gtk_list_select_item (GTK_LIST(special_action_list), count);
	return (TRUE);
}
Beispiel #12
0
void wxComboBox::SetSelection( int n )
{
    wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );

    DisableEvents();

#ifdef __WXGTK24__
    if (!gtk_check_version(2,4,0))
    {
        GtkComboBox* combobox = GTK_COMBO_BOX( m_widget );
        gtk_combo_box_set_active( combobox, n );
    }
    else
#endif
    {
        GtkWidget *list = GTK_COMBO(m_widget)->list;
        gtk_list_unselect_item( GTK_LIST(list), m_prevSelection );
        gtk_list_select_item( GTK_LIST(list), n );
        m_prevSelection = n;
    }

    EnableEvents();
}
Beispiel #13
0
void create_window(int *argc, char ***argv)
{
	GList *gtk_baud_list=NULL;
	int i;

	gtk_init(argc, argv);

	firmware_label = gtk_label_new("Firmware:");
	gtk_label_set_justify(GTK_LABEL(firmware_label), GTK_JUSTIFY_RIGHT);
	gtk_widget_show(firmware_label);

	firmware_entry = gtk_entry_new();
	gtk_widget_set_usize(firmware_entry, 110, 0);
	gtk_entry_set_text(GTK_ENTRY(firmware_entry), file_setting());
	gtk_widget_show(firmware_entry);

	program_button = gtk_button_new_with_label("Program Now");
	if (file_exists(file_setting())) {
		gtk_widget_set_sensitive(program_button, TRUE);
	} else {
		gtk_widget_set_sensitive(program_button, FALSE);
	}
	gtk_widget_show(program_button);

	line1_hbox = gtk_hbox_new(FALSE, 2);
	gtk_box_pack_start(GTK_BOX(line1_hbox), firmware_label, FALSE, FALSE, 2);
	gtk_box_pack_start(GTK_BOX(line1_hbox), firmware_entry, TRUE, TRUE, 2);
	gtk_box_pack_start(GTK_BOX(line1_hbox), program_button, FALSE, FALSE, 2);
	gtk_widget_show(line1_hbox);


	port_label = gtk_label_new("Port:");
	gtk_label_set_justify(GTK_LABEL(port_label), GTK_JUSTIFY_RIGHT);
	gtk_widget_show(port_label);

	port_entry = gtk_entry_new();
	gtk_widget_set_usize(port_entry, 80, 0);
	gtk_entry_set_text(GTK_ENTRY(port_entry), port_setting());
	open_serial_port(port_setting());
	gtk_widget_show(port_entry);

	baud_label = gtk_label_new("Baud:");
	gtk_label_set_justify(GTK_LABEL(baud_label), GTK_JUSTIFY_RIGHT);
	gtk_widget_show(baud_label);
	
	baud_combo = gtk_combo_new();
	for (i=0; baud_list[i] != NULL; i++) {
		gtk_baud_list = g_list_append(gtk_baud_list, baud_list[i]);
	}
	gtk_combo_set_popdown_strings(GTK_COMBO(baud_combo), gtk_baud_list);
	gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(baud_combo)->entry), FALSE);
	gtk_widget_set_usize(baud_combo, 75, 0);
	for (i=0; baud_list[i] != NULL; i++) {
		if (strcmp(baud_list[i], baud_setting()) == 0) {
			gtk_list_select_item(GTK_LIST(GTK_COMBO(baud_combo)->list), i);
			break;
		}
	}
	gtk_widget_show(baud_combo);

	line2_hbox = gtk_hbox_new(FALSE, 2);
	gtk_box_pack_start(GTK_BOX(line2_hbox), port_label, FALSE, FALSE, 2);
	gtk_box_pack_start(GTK_BOX(line2_hbox), port_entry, TRUE, TRUE, 2);
	gtk_box_pack_start(GTK_BOX(line2_hbox), baud_label, FALSE, FALSE, 2);
	gtk_box_pack_start(GTK_BOX(line2_hbox), baud_combo, FALSE, FALSE, 2);
	gtk_widget_show(line2_hbox);


	crystal_label = gtk_label_new("Crystal:");
	gtk_label_set_justify(GTK_LABEL(crystal_label), GTK_JUSTIFY_RIGHT);
	gtk_widget_show(crystal_label);

	crystal_entry = gtk_entry_new();
	gtk_widget_set_usize(crystal_entry, 80, 0);
	gtk_entry_set_text(GTK_ENTRY(crystal_entry), crystal_setting());
	gtk_widget_show(crystal_entry);

	mhz_label = gtk_label_new("(MHz)");
	gtk_label_set_justify(GTK_LABEL(mhz_label), GTK_JUSTIFY_LEFT);
	gtk_widget_show(mhz_label);

	line3_hbox = gtk_hbox_new(FALSE, 2);
	gtk_box_pack_start(GTK_BOX(line3_hbox), crystal_label, FALSE, FALSE, 2);
	gtk_box_pack_start(GTK_BOX(line3_hbox), crystal_entry, TRUE, TRUE, 2);
	gtk_box_pack_start(GTK_BOX(line3_hbox), mhz_label, FALSE, FALSE, 2);
	gtk_widget_show(line3_hbox);


	reboot_button = gtk_button_new_with_label("Reboot");
	gtk_widget_set_sensitive(reboot_button, TRUE);
	gtk_widget_show(reboot_button);

	bootloader_button = gtk_button_new_with_label("Booloader");
	gtk_widget_show(bootloader_button);

	quit_button = gtk_button_new_with_label("Quit");
	gtk_widget_show(quit_button);

	line4_hbox = gtk_hbox_new(TRUE, 2);
	gtk_box_pack_start(GTK_BOX(line4_hbox), reboot_button, TRUE, TRUE, 2);
	gtk_box_pack_start(GTK_BOX(line4_hbox), bootloader_button, TRUE, TRUE, 2);
	gtk_box_pack_start(GTK_BOX(line4_hbox), quit_button, TRUE, TRUE, 2);
	gtk_widget_show(line4_hbox);

	main_vbox = gtk_vbox_new(FALSE, 2);
	gtk_box_pack_start(GTK_BOX(main_vbox), line1_hbox, TRUE, TRUE, 2);
	gtk_box_pack_start(GTK_BOX(main_vbox), line2_hbox, TRUE, TRUE, 2);
	gtk_box_pack_start(GTK_BOX(main_vbox), line3_hbox, TRUE, TRUE, 2);
	gtk_box_pack_start(GTK_BOX(main_vbox), line4_hbox, TRUE, TRUE, 2);
	gtk_widget_show(main_vbox);

	main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
	gtk_container_add(GTK_CONTAINER(main_window), main_vbox);
	gtk_widget_show(main_window);
}
Beispiel #14
0
gboolean
on_key_treeview_selection (	GtkTreeSelection	*selection,
				GtkTreeModel		*model,
				GtkTreePath		*path,
				gboolean		path_currently_selected,
				gpointer		userdata                    )
{
	GtkLabel		*key_name_label = NULL;
	GtkEntry		*program_entry = NULL,
				*default_entry,
				*special_action_combo_entry;
	GtkRadioButton		*radiobutton,
				*default_radiobutton,
				*program_radiobutton,
				*special_action_radiobutton;
	GtkList			*special_action_list;
	GtkTreeView		*key_treeview;
	GtkTreeIter		iter;
	char			*key_name,
				*program_user = "",
				*program_default;
	KEY_SETTINGS		*selected_key;

	key_treeview = gtk_tree_selection_get_tree_view(selection);
	key_name_label = GTK_LABEL( lookup_widget(GTK_WIDGET(key_treeview), "key_name_label") );
	program_entry = GTK_ENTRY( lookup_widget(GTK_WIDGET(key_treeview), "program_entry") );
	default_entry = GTK_ENTRY( lookup_widget(GTK_WIDGET(key_treeview), "default_entry") );
	
	if ( gtk_tree_model_get_iter(model, &iter, path) ) /* If a row was selected instead of deselected */
	{
		/* Get the name of the selected key */
		gtk_tree_model_get (model, &iter, FIRST_COLUMN, &key_name, -1);
		if (key_name) /* If a listitem was selected instead of deselected */
		{
			default_radiobutton = GTK_RADIO_BUTTON( lookup_widget(GTK_WIDGET(key_treeview), "default_radiobutton") );
			program_radiobutton = GTK_RADIO_BUTTON( lookup_widget(GTK_WIDGET(key_treeview), "program_radiobutton") );
			special_action_radiobutton = GTK_RADIO_BUTTON(
				lookup_widget(GTK_WIDGET(key_treeview), "special_action_radiobutton") );
			special_action_combo_entry = GTK_ENTRY( lookup_widget(GTK_WIDGET(key_treeview), "special_action_combo_entry") );
			special_action_list = GTK_COMBO(lookup_widget(GTK_WIDGET(key_treeview), "special_action_combo"))->list;
			
			/* Block the signal handlers of the entries and the radiobuttons */
			gtk_signal_handler_block_by_func (	GTK_OBJECT(program_entry),
								(void *)on_program_entry_changed, NULL  );
			gtk_signal_handler_block_by_func (	GTK_OBJECT(default_radiobutton),
								(void *)on_default_radiobutton_toggled, NULL  );
			gtk_signal_handler_block_by_func (	GTK_OBJECT(program_radiobutton),
								(void *)on_program_radiobutton_toggled, NULL  );
			gtk_signal_handler_block_by_func (	GTK_OBJECT(special_action_radiobutton), 
								(void *)on_special_action_radiobutton_toggled, NULL  );
			gtk_signal_handler_block_by_func (	GTK_OBJECT(special_action_combo_entry),
								(void *)on_special_action_combo_entry_changed, NULL  );
			
			/* Select the first item of special_action_list */
			/* Select the matching list item of special_action_list */
			gtk_list_select_item (GTK_LIST(special_action_list), 0);
			/* Select the key in the linked list */
			selected_key = ksl_find_key( kbcfg_key_settings_list(&current_keyboard_config), key_name );
			/* Read the settings of the key */
			if ( strcmp( ks_get_program_user(selected_key), "default" ) == EQUAL )
			{
				radiobutton = default_radiobutton;
			}
			else if ( (*ks_get_program_user(selected_key) ==  ':') &&
				  (select_special_action(&plugin_list, ks_get_program_user(selected_key), special_action_list)) )
			{
				radiobutton = special_action_radiobutton;
			}
			else
			{
				program_user = ks_get_program_user(selected_key);
				radiobutton = GTK_RADIO_BUTTON( lookup_widget(GTK_WIDGET(key_treeview), "program_radiobutton") );
			}
			
			/* Show the settings of the key */
			gtk_label_set_text (GTK_LABEL(key_name_label), key_name);
			gtk_entry_set_text (GTK_ENTRY(program_entry), program_user);
			gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(radiobutton), TRUE);
			program_default = ks_get_program_default(selected_key);
			if (program_default[0] == ':') /* If program_default is a special action */
			{
				program_default++; /* Now the user only sees the name of the special action */
			}
			gtk_entry_set_text (GTK_ENTRY(default_entry), program_default);
			/* Unblock the signal handlers of the entries and the radiobuttons */
			gtk_signal_handler_unblock_by_func (	GTK_OBJECT(program_entry),
								(void *)on_program_entry_changed, NULL  );
			gtk_signal_handler_unblock_by_func (	GTK_OBJECT(default_radiobutton),
								(void *)on_default_radiobutton_toggled, NULL  );
			gtk_signal_handler_unblock_by_func (	GTK_OBJECT(program_radiobutton),
								(void *)on_program_radiobutton_toggled, NULL  );
			gtk_signal_handler_unblock_by_func (	GTK_OBJECT(special_action_radiobutton),
								(void *)on_special_action_radiobutton_toggled, NULL  );
			gtk_signal_handler_unblock_by_func (	GTK_OBJECT(special_action_combo_entry), 
								(void *)on_special_action_combo_entry_changed, NULL  );
		}
	}
	
	return (TRUE);
}
Beispiel #15
0
void combo_set_selection(Combo *combo, int item_index)
{
     gtk_list_select_item(GTK_LIST(GTK_COMBO(combo)->list),item_index);
}
Beispiel #16
0
static gint
gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxListBox *listbox )
{
    if (g_isIdle)
        wxapp_install_idle_handler();

    if (g_blockEventsOnDrag)
        return FALSE;

    bool ret = false;

    if ((gdk_event->keyval == GDK_Tab) || (gdk_event->keyval == GDK_ISO_Left_Tab))
    {
        wxNavigationKeyEvent new_event;
        /* GDK reports GDK_ISO_Left_Tab for SHIFT-TAB */
        new_event.SetDirection( (gdk_event->keyval == GDK_Tab) );
        /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */
        new_event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) );
        new_event.SetCurrentFocus( listbox );
        ret = listbox->GetEventHandler()->ProcessEvent( new_event );
    }

    if ((gdk_event->keyval == GDK_Return) && (!ret))
    {
        // eat return in all modes
        ret = true;
    }

#if wxUSE_CHECKLISTBOX
    if ((gdk_event->keyval == ' ') && (listbox->m_hasCheckBoxes) && (!ret))
    {
        int sel = listbox->GtkGetIndex( widget );

        wxCheckListBox *clb = (wxCheckListBox *)listbox;

        clb->Check( sel, !clb->IsChecked(sel) );

        wxCommandEvent new_event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, listbox->GetId() );
        new_event.SetEventObject( listbox );
        new_event.SetInt( sel );
        ret = listbox->GetEventHandler()->ProcessEvent( new_event );
    }
#endif // wxUSE_CHECKLISTBOX

    // Check or uncheck item with SPACE
    if ((gdk_event->keyval == ' ') && (!ret) &&
         (((listbox->GetWindowStyleFlag() & wxLB_MULTIPLE) != 0) ||
          ((listbox->GetWindowStyleFlag() & wxLB_EXTENDED) != 0)) )
    {
        int sel = listbox->GtkGetIndex( widget );

        if (sel != -1)
        {
            ret = true;

            if (listbox->IsSelected( sel ))
                gtk_list_unselect_item( listbox->m_list, sel );
            else
                gtk_list_select_item( listbox->m_list, sel );

            wxCommandEvent new_event(wxEVT_COMMAND_LISTBOX_SELECTED, listbox->GetId() );
            new_event.SetEventObject( listbox );
            wxArrayInt aSelections;
            int n, count = listbox->GetSelections(aSelections);
            if ( count > 0 )
            {
                n = aSelections[0];
                if ( listbox->HasClientObjectData() )
                    new_event.SetClientObject( listbox->GetClientObject(n) );
                else if ( listbox->HasClientUntypedData() )
                    new_event.SetClientData( listbox->GetClientData(n) );
                new_event.SetString( listbox->GetString(n) );
            }
            else
            {
                n = -1;
            }
            new_event.SetInt(n);
            listbox->GetEventHandler()->ProcessEvent( new_event );
        }
    }

    if (ret)
    {
        gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" );
        return TRUE;
    }

    return FALSE;
}