Re: [gtk-list] Best way to make a dialog..



A struct seems like a perfectly good thing to use to pass the pointers:

struct entries{
GtkWidget *entry1, *entry2, entry3;
};

struct entries entry_ptrs;

gtk_signal_connect(GTK_OBJECT(ok_button), "clicked",
GTK_SIGNAL_FUNC(callback_func), entry_ptrs);

void callback_func(GtkWidget *widget, struct entries entry_data)
{
   blah...
}

You could also use an array of 3 widgets which might save you a little memory,
but it really isnt that significant.

Sean Cody wrote:

> supposed I have 3 ints in a struct called trois_int which holds the data
> entered in from a dialog box.
>
> would i just return this structure from a function.
>
> MyData = make_dialog_go_now();
> or would I have to pass the data variable in the function
> make_dialog_go_now(MyData);
>
> Any suggestions or examples?????
>
> Sean Cody (aka NullStream)
> umcodysw@cc.umanitoba.ca (SCHOOL)
> tdr@fuzyscsi.dhs.org      (HOME)
> seanc@pangea.ca           (WORK)
>
> "If God's my witness then God must be blind."
>         Garbage - As Heaven Is Wide
>
> --
> To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]