[gtkmm] The cursor in a Gtk::TreeView



I have tried it has to simulate the dispatch of a pressure of a key to
Gtk::TreeView:

  Gtk::TreeView *m_pTreeview = ...
  
  ...

  GdkEventKey event;

  event.type             = GDK_KEY_PRESS;
  event.state            = 0;
  event.window           = gtk_tree_view_get_bin_window(m_pTreeview->gobj());
  event.send_event       = TRUE;
  event.time             = gtk_get_current_event_time();
  event.keyval           = GDK_Down;
  event.length           = 0;
  event.string           = 0;
  event.group            = 0;
  event.hardware_keycode = 0;

Signal emit:

  g_signal_emit_by_name(G_OBJECT(m_pTreeview->gobj()),
    "key_press_event", &event);

It doesn't work :-(  

Direct call:

  GTK_WIDGET_GET_CLASS(((Gtk::Widget *)m_pTreeview)->gobj())->key_press_event(
    GTK_WIDGET(m_pTreeview_movie->gobj()), &event);

It doesn't work :-(  

Otherwise I have used another signal:

  g_signal_emit_by_name(G_OBJECT(m_pTreeview->gobj()), "move_cursor", 
    (GtkMovementStep)Gtk::MOVEMENT_DISPLAY_LINES, 1);

It doesn't work :-(  

Where am I wrong ? 

Is it possible to simulate the pressure of the keys ?


-- 
Mario Ambrogetti  mailto:mario assi polito it
Torino Italy



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