re: Ok button key binding

2008-11-14 Thread Garth's KidStuff
 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
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Ok button key binding

2008-11-14 Thread Till Harbaum / Lists
Hi,

Am Freitag 14 November 2008 schrieb Garth's KidStuff:
 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
Thanks, that was my problem! This works in those dialogs that have entries.
Now i am still facing a similar issue with dialogs containing a gtktreeview 
based
list. Pressing return selects an item in that list, but not the default dialog 
button.
Any hint how to cope with the treeview? Unfortunately it doesn't have a
set_activates_default() function ...

Thanks again,
  Till
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Ok button key binding

2008-11-14 Thread Garth's KidStuff
shoot.  Nope, I don't have an off-the-top-of-my-head idea for you.  Except
to maybe get notified on every keypress and filter the return by hand.  Not
sure how to do that, though.  Let me know if you get a good answer to this
one.

On Fri, Nov 14, 2008 at 12:02 PM, Till Harbaum / Lists [EMAIL PROTECTED]wrote:

 Hi,

 Am Freitag 14 November 2008 schrieb Garth's KidStuff:
  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
 Thanks, that was my problem! This works in those dialogs that have entries.
 Now i am still facing a similar issue with dialogs containing a gtktreeview
 based
 list. Pressing return selects an item in that list, but not the default
 dialog button.
 Any hint how to cope with the treeview? Unfortunately it doesn't have a
 set_activates_default() function ...

 Thanks again,
   Till




-- 
Garth Upshaw
Garth's KidStuff
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list