[Techtalk] More questions about C and GTK+ stuff

Michelle Konzack linux4michelle at freenet.de
Sat May 12 10:53:24 UTC 2007


Hello,

The GTK+ GUI is driving me crazy!!!
Only the GUI stuff is nearly 8 times bigger then the rest of the app. :-/

I hope, I find a GTKgrrl here...  :-)

Now I know, WHY I am singel-task-console-geek! (I am coding since 1971)
DOS-Coding is coooool, since no other process can my appa kick off!

What I want to try is to get an application threated since it is
neccesary to

1)  "mailapp"
    GtkTreeView 1:   poll the imap server for new messages
                     or new created directories
    GtkTreeView 2:   Update the opened folder if new messages arrive

2)  "calendar"       react on user programed events
3)  "webdav"         update current folder if new files are appearing
4)  ...
...
999999) ...

OK, as I was learning GTK+, I have learned I must use at then end of
the GTK declaration gtk_main() to open the menu, but now it sleeps if
I do nothing... (But it works for simpel Admin-Stuff :-)  )

OK, I have found some stuff  :-)

----8<------------------------------------------------------------------
int main(int argc, chat *argv[])
{
    gtk_set_locale ();
    gtk_init (&argc, &argv);
    ...
    mainwin = gtk_window_new (GTK_WINDOW_TOPLEVEL);

    <create the main window stuff>;

    <load shared libs and create notebook tabs>;

    gtk_widget_show_all (mainwin);

    while ( endless == TRUE )
    {
        while ( gtk_events_pending() )
            gtk_main_iteration();

        <do other stuff like updating widgets and listings>;

    }
    exit (0);
}
----8<------------------------------------------------------------------

Which mean, after loading the Main-Window, the App is looking for the
libs to load and then enter a loop which could only be exited with a
"FALSE" value provided by an Exit command from the GUI.

But now I have a problem!

The polling of the "imap" server takes ages, since I have over 2300
folders and 7.54 million messages in MY maildir.  This will block the
gtk_main_iteration() if I try to do something with the GUI.

Maybe I should use gtk_main_iteration_do() instead of then "while" thing.

It seems, that this can only be done/solved with multi threating...
BUT HOW?

Thanks for your help
    Michelle Konzack


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
                   50, rue de Soultz         MSN LinuxMichi
0033/6/61925193    67100 Strasbourg/France   IRC #Debian (irc.icq.com)


More information about the Techtalk mailing list