The prototypes of GIOSchedulerJob func is :
gboolean func(GIOSchedulerJob*, GCancallabel*, gpointer);
If you want to pass some data to that function use a structure as it's
user_data, for example.
struct data {
int a, b;
};
gboolean job_func(GIOScheduler *job, GCancellable *cancellable, gpointer
user_data)
{
struct data *data = (struct data*) user_data;
...
}
...
/*
* Caller function.
* Either by use pointer to struct data and allocate it or by unary operator.
* We use unary operator here to directly give the address.
*/
struct data data;
g_io_scheduler_push_job(job_func, &data, notify_func, prio, cancellable);
....
Notice you will get many function like this in GTK+, it's important to cleary
understand this method.
Ardhan,
--- [email protected] wrote:
From: Alexander Kuleshov <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Re: GIOScheduler example need
Date: Fri, 25 Jun 2010 14:36:01 +0600
And if i whave functions with some parametes?
For example:
static gboolean job_func(int a, int b)
{
...
}
How can i send parameters in g_io_scheduler_push_job?
Thank you
_____________________________________________________________
Listen to KNAC, Hit the Home page and Tune In Live! ---> http://www.knac.com
_______________________________________________
gtk-app-devel-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list