Re: gtk_label_set_text () BUG !?!?!?!??!?!?!??!!? ( N00b )



hm wrote:

Hi !

 I`m not quiet sure if my previous mail was sent, so I`ll try to write it once again.
Lieven van der Heide wrote, that I should call all gtk functions from one thread. I`ve tried :

1. Created function in main program, that calls gtk_label_set_text (). The function takes string as a ( from <string> ) parameter, which is converted to c-language string by string. c_str ()

2. Thread function gets pointer to function from point 1. as a parameter, and when specific conditions arefulfilled, then the function from point 1. is beiung called ( by the pointer passed as an argument for thread function )

Result : the same :/
Because your not doing anything different.

Any clues ? :)
Yes,
please save yourself (and all of us) alot of effort by finding out the meaning of threads, if you dont have a good understanding about threads, your program will crash and lock up I garauntee it, you will also find yourself unable to properly
phrase questions about why its not working - because you havent figured out
the meaning of your questions yet.

Cheers,
                                 -Tristan

I'm not about to write a book here but here's a little hint to justify my rant:

- Threads share data throughout the process address space, all data belongs to the 'program' or 'process', if you are currently executing thread B, then function calls from thread B will be run in thread B; regardless of in which
     object file the stub happened to be built in and linked from.

- When you use an idle handler (g_idle_add()) to schedule an event in the mainloop, this will result in a write to a pipe() that is used to wakeup the GMainContext of the mainloop (usually in the main thread), again - regardless of what object file the idle handler was declared in - it will be run from the main thread of execution.





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