Re: Threads and main-loops



Can you just convert what you need into signals?  Then you can store
each of your document windows into a GList (or a STL vector) and
manage your documents that way.  When each of the signals is fired the
current document can handle the event.

Is there a reason you need a seperate thread per document?  Personally
I would just keep one thread dedicated to the UI.  Then whatever
requires seperate threading can be done in a signal call and close up
when finished.

-Matt


On Wed, 15 Dec 2004 03:17:59 +1100, Russell Shaw <rjshaw netspace net au> wrote:
Hi,
I want to make an app that can have multiple top-level windows open, each
of which contains a document being edited. If a user was half way thru
doing something in one document window, then clicks another document
window and does something there, then goes back to doing something in
the first window, i want the context of these windows to be maintained.
So, one application should give the illusion of multiple instances of a
simpler single-document application.

Could i do this by using a separate thread for each document window,
where each thread has its own g_main_loop and g_main_context ?
Will gtk widgets work properly without needing locking and mutexes etc?
I need to use one thread per window because the execution point goes
around a complicated super loop, and each document/window has one.

Even tho this isn't window-in-window, is this classed as MDI, or SDI?

I want one main menu that can control settings common to all the
open windows/documents.

I've never used fork before, but this should give me the effect
of multiple invocations of gtk, while still having them glued to
a parent process using pipes: http://www.gtk.org/faq/#AEN506

Is this the most common and recommended way to get the effect?
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



-- 
Matt Jarjoura

"To announce that there must be no criticism of the 
president, or that we are to stand by the president,
right or wrong, is not only unpatriotic and servile, 
but is morally treasonable to the American public." 
- Theodore Roosevelt (1918)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]