Re: [gtk-list] GtkEntry...
- From: Damon Chaplin <damon karuna freeserve co uk>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] GtkEntry...
- Date: Fri, 26 Mar 1999 23:06:39 +0000
ZioBudda wrote:
> now, in the main window I have a Button call "ok" and I want to associate
> the "pressed" event with a my function ("on_ok_pressed") and I want to
> pass "contain" variable. I (with glade) have write this code:
>
> gtk_signal_connect(GTK_OBJECT (ok), "pressed",
> GTK_SIGNAL_FUNC (on_ok_pressed),
> (struct _contain*)&contain);
That looks OK, but you can just use this:
gtk_signal_connect (GTK_OBJECT (ok), "pressed",
GTK_SIGNAL_FUNC (on_ok_pressed),
&contain);
> This is on_ok_pressed function:
> void
> on_ok_pressed (GtkButton *button,
> struct _contain contain)
> {
> printf("%s",gtk_entry_get_text(GTK_ENTRY((GtkWidget *)contain.port)));
> }
This is the problem. It should be
void
on_ok_pressed (GtkButton *button,
struct _contain *contain)
{
printf ("%s", gtk_entry_get_text(GTK_ENTRY(contain->port)));
}
Damon
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]