RE: GTK+ Love
- From: "Sharma Nitin-A21652" <nitinsharma motorola com>
- Cc: <gtk-devel-list gnome org>
- Subject: RE: GTK+ Love
- Date: Mon, 5 Mar 2007 22:31:51 +0800
Hi,
In what free time I have, I do experiments with Gtk+.
I tried adding a custom event for academic purpose only in the
gtk_widget.
To add the event handling for the additional event in the widget, I
followed the following steps. (Hope this might be of some help).
1) Add a function pointer in _Gtk<widget>Class that will be the signal
function in the .h file as --> "<return_type>
(*custom_event_signal)(GtkWidget *widget, GdkEvent *event);"
2) Add an enum value EVENT_TO_BE_HANDLED to the enum that contains the
signals to be handled, to provide the offset in <widget>_signals array
in .c file of the widget.
3) Add an entry in gtk_widget_class_init() to initialize the signal
"klass->custom_event_signal = (custom_function_pointer)".
4) For the offset enum in step 2 above, added in <widget>_signal array,
assign the signal as <widget>_signal[EVENT_TO_BE_HANDLED] = g_signal_new
( <with appropriate parameters> ).
5) custom_function_pointer implements the functionality (Like emiting
some events, updating the internal data structures of the widgets. Etc.)
that one wants to accomplish for the events.
Is this something near to what you are attempting to achieve?
Best regards,
Nitin Sharma
-----Original Message-----
From: gtk-devel-list-bounces gnome org
[mailto:gtk-devel-list-bounces gnome org] On Behalf Of Murray Cumming
Sent: Monday, March 05, 2007 6:08 PM
To: Bob Murphy
Cc: gtk-devel-list gnome org
Subject: Re: GTK+ Love
On Sat, 2007-03-03 at 00:49 -0800, Bob Murphy wrote:
[snip]
> This all sounds like a great idea. I work for a company that's
> actively using and modifying various open-source components, including
> GTK+, and this would be a good way to get involved with the community
> and learn how to submit changes back to the trunk. Also, some of the
> listed bugs are for GtkCalendar, and I've been adding features and
> working on its internals lately, so they'd almost be a slam-dunk.
[snip]
Very cooll. I'd really like to be able to add event information to the
GtkCalendar cells. Is this something you are working on?
--
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]