cplusplus.com
C++ : Forum : UNIX/Linux Programming : gtk + linux
 
cplusplus.com
Information
Documentation
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs


solved gtk + linux

xcoder (9)
Hello again!

I can't figure something out...

How can I send more than one argument to function using g_timeout_add?

I have function which requires 10 gtk widgets, and problem is that with g_timeout_add I know how to send only one. Example for one argument gtk_timeout_add(1000, volume_update, (gpointers)snd1); but I need from snd1 to snd10!

Didn't know where to post this but I'm using ubuntu 9.04 if that matters!

Best regards!
Last edited on
Zaita (2292)
Use a for-loop
xcoder (9)
Thanks great idea! Before I thought maybe I need to create some kind of structure! :D
ioctl (9)
If you want all the pointers to be passed to the timer callback without having to create 10 different timers, you can pass an array of pointers as an argument. Or if you are using C++, a STL list.
Topic archived. No new replies allowed.