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



On 08/18/2013 01:48 PM, Markus Elfring wrote:
You're right about my desire to log text in a gui window.  I don't want a list
box or control widgets in this particular case.  As far as sophisticate widgets,
I don't want any widgets at all.
There might still be a few more technical details which you would like to
consider for your log viewer implementation.


If there's something wrong with my example, I appreciate any comments or
suggestions.  But if someone says it wrong and use programming terms that I
don't fully understand, it's not much I can do with it as far as change and
actually have it continue to perform the desired task (update the gui window
after running a function).
How do you think about a message display in several log windows from one
application in parallel?

How do you keep the graphical user interface responsive during this output?
http://c2.com/cgi/wiki?EventDrivenProgramming

Regards,
Markus

Thanks, Markus. Since I describe myself as novice to some of this technical jargon you probably think I'm not clear with what I'm looking for. But I actually am. The example that I posted is very consistent with the namesake of this thread. I'm hoping to have the minimum number of lines to update a gui window without the user having to do anything but just periodically look at the screen and notice the updates.

Now since I appear to have the minimum (in my example), which performs perfectly. If you analyze it, I believe it'll become clearer what my question is about.

Having the minimum lines will help me to study in more detail and understand better what is taking place.

Do you see any technical problems with what I posted? Do you think you could make it more efficient? I'm sure, with time, I'll be able to.

One of the things I would like to do is turn this lines into one line:

// Code Begin
// ----------------------------------------------
    texttoprint += "Back from running a short 10 second function";
    m_refTextBuffer->set_text(texttoprint);
    m_textview.set_buffer(m_refTextBuffer);
// ----------------------------------------------
// Code end

Of course I expect this will take a significantly lots more programming lines to make such a class or function. But in the end it'll make using gtk a lot easier for many applications.

I hope to create a class or function that could be called and would either append or replace the text being displayed. The function could be called, "gprint()". Then, instead of writing three lines to update the gui window, I'd be able to type:

gprint("Updated text");

And have the text updated that way.

Thanks again for your input and your attempts to understand my question.

Again, I believe the current question is answered with the last code I posted, unless you see a problem with it. After I have a good clean example of my attempt to create the "gprint()" class or function, I'll post that and ask for help.

-- 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]