re: Ok button key binding



Also how do i make the Ok button to react on the return key.

Hey there.  This is in gtkmm:

    Gtk::Button m_IDOK;
...
    m_IDOK.set_flags(Gtk::CAN_DEFAULT);
    m_IDOK.grab_default();

The one subtle point for me was that any Gtk::Entry controls in the dialog
ate the return unless I did the following:

    Gtk::Entry m_IDC_ADD_PAGE_TITLE;
...
    m_IDC_ADD_PAGE_TITLE.set_activates_default(true); // Enter while editing
should activate default OK

Happy coding.

-- 
Garth Upshaw
Garth's KidStuff



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