Re: [gtk-list] Don't know why this does not work.
- From: Fredrik Hallenberg <hallon lysator liu se>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Don't know why this does not work.
- Date: Sun, 9 Jan 2000 10:31:55 +0100
On Sun, Jan 09, 2000 at 07:18:44PM +1100, Bill Shui wrote:
> void hello(GtkWidget *widget, GdkEvent *event, gpointer data)
> {
> ...
> }
> void crap(GtkWidget *widget, GdkEvent *event, gpointer data)
> {
> ...
> }
>
> I get something like these printed out in my terminal:
> ¸ct@\ was pressed <--- it should print "crap button was pressed"
>
> pct was pressed. <-- it should print "hello button was pressed"
>
>
The problem here is your callbacks, they should be defined as:
void hello(GtkWidget *widget, gpointer data)
{
...
}
No GdkEvent pointer is passed to a "clicked" callback so with your code you
will get the char pointer in the event parameter and just junk in the data
parameter.
--
Fredrik Hallenberg hallon@lysator.liu.se
http://www.lysator.liu.se/~hallon hallon@debian.org
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]