Setting a default control in a windows



Hello All,

Gonna try this question again:

I am trying to set a button in my window to be the "default" widget, i.e. this buttons "on_clicked" connected function will be executed when the enter key is pressed when this window has focus.
The code I'm using is as follows:

  default_button->set_flags(Gtk::CAN_DEFAULT);
  default_button->grab_default();
  this->activate_default();

and is in the constructor for my window. This code is called after the button in question has been added to the window.

Upon execution and the enter key is pressed, nothing happens. Any ideas on what I'm omitting or doing wrong here?

Thanks,

Bob Caryl <bob fis-cal com>



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