Re: GtkEntry and clipboard
- From: Havoc Pennington <hp redhat com>
- To: Alex Biryukov <alex vabank kiev ua>
- Cc: Mailing list gtk <gtk-list gnome org>
- Subject: Re: GtkEntry and clipboard
- Date: 06 Aug 2001 03:46:49 -0400
Alex Biryukov <alex vabank kiev ua> writes:
> It's fine, but when ?
> I need popup Copy/Cut/Paste menu. I tried catch "event" event for
> GtkEntry, but selection is cleared before(signal "GDK_SELECTION_CLEAR"
> fired before passing to "event" handler).
Ah, right. Try "button_press_event" instead of "event" - I believe
button_press_event handlers get to run first.
Then override the default behavior by using
gtk_signal_emit_stop_by_name() to block further signal handlers. (In
GTK 2 you can also stop further handlers by simply returning TRUE.
And of course in nearly all cases handler-blocking is a shortcut to
avoid subclassing the widget, which would be more elegant in some
theoretical sense.)
Actually in GTK 2 the c/c/p menu is there on the entry by default, so
I guess the fact that this is easier to implement in GTK 2 isn't
interesting. ;-)
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]