Re: intercept key press



On Thu, Jun 10, 2004 at 02:40:04PM +0000, vivi popo wrote:
in my program i want to close a dialog when the user presses the "Esc" 
button

In Gtk+2 this should often happen automatically.
Otherwise you can create an accelerator group, attach it to
the dialog with

  gtk_accel_group_attach(accel_group, dialog);

and make Escape `press the dialog Cancel/Close button'

  gtk_widget_add_accelerator(close_button, "clicked", accel_group,
                             GDK_Escape, 0, 0);

Yeti


--
Do not use tab characters. Their effect is not predictable.



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