Dangers of inline dialogs?



Hello,
  I used to use the trick of inlining dialogs (where you
make your own mini event loop while waiting for a response
from a querying dialog), until I saw the danger of
"re-entering" your code somewhere else while in your mini
loop (the code somewhere else might destroy the data
structure housing the mini loop as part of some cleanup
process). It turns out this could happen quite a bit, and
the frequency depended not on my code, but upon a particular
series of button click/keypress inputs by the user (the user
might spawn the querying dialog, and quickly spawn some
other event that has the result of destroying the dialog
itself, *while we're still looping in it*).

  After investigating further, I noticed it didn't appear
possible to get around this, because no matter what you did
you never knew what might already be on the input queue, and
you don't want to just go deleting events haphazardly. So
now I take the slightly more difficult route of
restructuring my code to use callbacks rather than inlining.

OK, finally to my question. I used Motif in the examples
above, but I was wondering if gtk had some alternative
approach where it would again be feasible to use inlining?
I am also shamelessly using this opportunity to see if
anyone else has had similar problems, in gtk or Motif, and
compare notes, because, who knows, maybe all this time I
made a wrong assumption somewhere. Thanks, and a pat on the
back to you if you read through this far. :)

	Brian



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