Re: Hook user loop into program

2011-04-17 Thread Robert Park
On Sat, Apr 16, 2011 at 5:04 AM, Marco wrote: > Where should I put the function > DoSomeStuff()? I attached a minimal example, it's written in lua. You should call DoSomeStuff() immediately before gtk.main(), but at the end of the loop in DoSomeStuff you will need to add this code: while gtk.eve

Re: Hook user loop into program

2011-04-17 Thread Bill C
Once gtk-main is called, it waits for something to do. Normally this would be a result of some user interaction. Either use a "Run" button to get some action or use a timer to interrupt and start the processing. Rgds Bill On 17/04/11 16:15, Maklakov Andrey wrote: Hello. I'm not experie

Re: Hook user loop into program

2011-04-16 Thread Maklakov Andrey
Hello. I'm not experienced in gtk+ too. But I think you should connect call of your function to some gtk event (g_signal_connect). Updating progress bar you should connect to timeout or idle event (read about g_timeout_add, g_idle_add). And in your function call: while (gtk_events_pendi

Hook user loop into program

2011-04-16 Thread Marco
Hi, I'm a novice in gtk and I face some problems getting started. I don't find a solution in the manual (although I'm pretty sure it's in there) because I don't know what to look for. I create a main window (top level window) with a progress bar. What I want is to display the window and then exec