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



On 08/19/2013 05:22 AM, Markus Elfring wrote:

As far as you seeing a technical problem, is it possible that you could post some code that would actually work to identify the problem?

Your function "HelloWorld::cpp_app" indicated in this example that it will execute for some seconds. I got doubts that the graphical user interface will be as responsive as you might expect it. A well-known approach is to perform long lasting data processing in a dedicated thread which is separate from the one which serves the user interface. You need to be very careful with synchronisation so that you avoid thread-unsafe data accesses.
http://en.wikipedia.org/wiki/Synchronization_%28computer_science%29
Thanks, Markus. While I can't understand what you're suggesting, I really appreciate the input as well as the specifics. I have all the documentations that the users from the list has given me. I'm studying all of it. It's a lot for a novice. But I'm not taking any of it light.

Most of the details don't have examples that I can test and I'm spending a lot of time cross referencing trying to understand the terms in the technical documentations.

As far as the function executing for some seconds, it executes for fractions of a second, minutes, hours, perfectly totally as I expect as well as totally as desired.

As far as I can see, the function that you picked out is the exact function that was provided to me by Alan, and discussed by a number of the professionals in this mail list as being functional. The only difference as I can see is the name. I took Alan's code and tried to learn it in such that I could rewrite it and give descriptive names according to what I was looking for the function to do.

I also changed the widget from label to textview.

Can you tell me what is different between the two functions:

My example:
HelloWorld::cpp_app

Alan's example:
myLabel::myprocess1

By the way, I left the "HelloWorld" part because I was trying to keep it as consistent with the example in the documentation tutorial as possible. The class and function names are different in my actual application. I'm able to make this differences because (I thought) I had come to understand what Kjell and Alan had given me.

I'm not good enough to read the highly technical links that you're providing me with to make radical changes to the code at this point. Kjell recognized the tutorial conatains a chapter on multi-threaded programs (from this message:
New multi-threaded example program in the gtkmm tutorial:
https://mail.gnome.org/archives/gtkmm-list/2013-August/msg00055.html

He indicated that it lacked an example. The lack of example makes it hard for a novice to grasp (as in my case). So after Alan's assistance, which actually resolved my issue, Kjell added a tutorial with an example, which I tried to model my code after.

If there is a difference between Alan's code and my updated version, I'd appreciate knowing the difference. I still wouldn't be able to change it without an example of the specific lines that would fix it. Any changes that I made will actually brake the code and the gui window would lost it's responsiveness, or not display at all.

This was happening when I simply tried to change Alan's code from a label widget to a textview widget. The lost of functionality was the purpose of this thread. I was hoping to see the bare essentials. I thought, after many hours that I had found the key (studying Alan's and Kjell's examples).

I'm studying in detail the links that you're providing, but I can't see from those links what specific I should change and still have the code function as desired.

-- L. James

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



I can't say I fully understand it.

Do you like a different description about GUI architectures?
http://martinfowler.com/eaaDev/uiArchs.html

Regards,
Markus



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