2009/4/9 Atis <dra...@freemail.hu>: > > I would like to use the keypress eventĀ (C#) to decide whether the content > of a textview widget has changed or not at the exit of an application. If it > changed, I ask whether I should save the modification or not. My problem is > that the keypress event captures only the Lshift, Rshift, Caps lock keys, > but not the regular "letter" and "number" keys.
Why not use the TextView's buffer's Modified flag? http://www.go-mono.com/docs/index.aspx?link=P:Gtk.TextBuffer.Modified (The reason you can't capture all the keystroke events is that the textview is subscribed to the key events itself in order to capture key input, and when it "consumes" keystrokes it prevents the event from propagating to other handlers. You can work around this, as Chris said, by putting the [GLib.ConnectBefore] on your handler, which causes GTK# to insert your handler *before* the widget's own handler). -- Michael Hutchinson http://mjhutchinson.com _______________________________________________ Gtk-sharp-list maillist - Gtk-sharp-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/gtk-sharp-list