Re: [gtk-list] Patches for gtkwidget.[ch]
- From: Tim Janik <timj gtk org>
- To: GTK List <gtk-list redhat com>
- Subject: Re: [gtk-list] Patches for gtkwidget.[ch]
- Date: Thu, 2 Mar 2000 03:01:22 +0100 (CET)
On Wed, 1 Mar 2000, Kent Schumacher wrote:
> Hi,
>
> Following the instructions posted in the gtk+ HACKING file, I'm posting this
> patch against Gtk 1.2.7. I've been unable to get to ftp.gimp.org to upload this
> patch or to read the instructions there for naming patches.
>
> Basically this patch adds a signal to gtkwidget (replacing one of the padded
> placeholder signals at the end of the class definition).
>
> The signal simply allows triggering a widget signal handler and passing data
> through it. In other words, an application would connect a signal handler
> for to a widget for the "user_action" signal.
>
> The user_action handler has the signature
>
> void handler(GtkWidget *w, gpointer emitter_data, gpointer data)
>
> The signal handler can be triggered anywhere in the application by
> using the function.
>
> gtk_widget_user_action (GtkWidget *widget, gpointer emitter_data)
>
> This allows the emitter to trigger a widget with arbitrary data.
> I feel this is needed this for easily triggering widgets via menu-item,
> toolbar-button, and keypress. Currently doing this is simply too
> unwieldy.
i don't think this is a good idea for gtk proper, for one this signal
is impossible to wrap by language bindings (due to the generic pointer),
and then some users may want varying signals, e.g. one with a return
value etc...
second, we don't need to integrate this into gtk proper, just create
your signal with gtk_object_class_user_signal_new() (omitting the
default hanlder portion) without modifying gtkwidget internals, to get
the same effect.
>
> I'm happy to justify this patch at greater length if anyone is interested (grin)
> Thanks,
> Kent
>
>
---
ciaoTJ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]