Re: What is the minimum number of lines to update a gui window without user clicking a button



On Sat, 2013-08-10 at 16:45 +0100, Chris Vine wrote:

Your posts are no doubt highly meritorious but I am afraid they are not
offering much clarification.  You would probably make your point better
if you shortened your posts by roughly an order of magnitude.  However,
after cutting through the dense undergrowth, I still think you have
failed to understand how programs using event loops work.  If the
program is not just running a single batch of instructions, it has to
have a loop in there somewhere, which is blocking until there is
something to process.  The simplest loop for your console program would
involve blocking on select() or poll(), for which purpose presumably
you must have a file descriptor to poll on.  In that case, as I said,
you can do the same with Glib::signal_io().connect().  Or maybe you are
polling using timeouts, in which case the equivalent for gtkmm is
Glib::signal_timeout().connect().

Why not get to the heart of the matter, and post a short compilable
console program, cut down from the ones which you appear to have written
for monitoring VPNs, but of no more than 50 lines, and we can tell you
how to do the same using a graphical interface.

Chris

I'll accept the admonishment.  I'm sorry for the verbose description.  It appears that you're starting to get the gist.  I appreciate your asking me to expound with an example.

The VPN application currently have 500 lines.  I'll strip it down to 50, making sure it retains functionality and post it.

One of the reasons I didn't post it before, but posted "sleep(10)" to represent the application was doing something, because the program is designed to make changes to the system.  But, I'm sure I'll be able to comment and have such a flow that you might be able to easily follow it just by looking at it, or, on your own, comment out the parts that makes changes.

Thanks!

-- L. James

--
L. D. James
ljames apollo3 com
www.apollo3.com/~ljames

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