Re: Quitting an application

2008-03-31 Thread Andreas Stricker
Sujith wrote: > 1 * Init various GUI elements including the track treeview. > 2 * Read the DB and append elements to the treeview. > 3 * call gtk_main() and wait for events. What about: 1. Init various GUI elements including the track treeview. 2. Install a g_idle callback. 3. call gtk_main() and

Re: Quitting an application

2008-03-30 Thread G Hasse
On Thu, Mar 27, 2008 at 08:01:40PM +0530, Sujith wrote: > Hi, > > I am writing a music library manager and I have a small problem when > terminating the application. > On starting the app, I scan a DB and load the tracks into a treeview. > When this is in progress, if the user closes the applicat

Re: Quitting an application

2008-03-28 Thread Sujith
Bastiaan Veelo writes: > I have not checked, but maybe gtk_main_leve() returns 0 if gtk_main() > has not been called yet? If that would be of any help. Yes, I checked and it does return 0 before gtk_main() has been called. I'll play around with it. Thanks for the tip. Sujith __

Re: Quitting an application

2008-03-28 Thread Bastiaan Veelo
Sujith wrote: > Gabriele Greco writes: > > Intercept the delete_event or modify the callback where you do the > > gtk_main_quit() and insert there some thread sync code. > > > > You should take care also when you add the rows to your Tree/ListStore if > > you do that directly from the thread

Re: Quitting an application

2008-03-28 Thread Sujith
Gabriele Greco writes: > Intercept the delete_event or modify the callback where you do the > gtk_main_quit() and insert there some thread sync code. > > You should take care also when you add the rows to your Tree/ListStore if > you do that directly from the thread that scans the db. > >

Re: Quitting an application

2008-03-28 Thread Sujith
G Hasse writes: > This is a quite common problem in GUI design. How do you syncronize > between a long job and a short fast one (as quitting). The first answer > is that you should not do any long jobs. You should split the long work > in small ones, and let every other job have the ability t

Re: Quitting an application

2008-03-27 Thread Gabriele Greco
> > I am writing a music library manager and I have a small problem when > terminating the application. > On starting the app, I scan a DB and load the tracks into a treeview. > When this is in progress, if the user closes the application, a segfault > occurs > because gtk_main_quit() has been call