Re: GUI problem.



Hi Alberto,

Sorry, I'm not sure that I follow you.  I think that you are saying
that you want to write the C file by yourself.  I was simply hoping to
give you some pointers/recommendations.  If you still don't want to
offer-up the source then maybe you can explain what your application
does, where it calls a thread(s), what you are doing in that thread,
and what things are going on in the main thread.  Make sure that you
mention where you are calling gtk_threads_*() and how you have called
g_main_loop_run()/gtk_main().

I have written a few multi-threaded applications that call
multi-threaded UI libraries.  I'm the upstream for Me TV
(https://launchpad.net/me-tv) and I have been bitten hard by
multi-threaded bugs.

This might not be a multi-threaded issue, it's just a hunch.

Thanks,

Michael


On 20/11/2007, alberto barbaro <khlero83 gmail com> wrote:
Thanks for all but i will the .c by myself.
I can't update the GUI from the main because i use the thread. If I comment
the istruction where I launch the thread the problem will not disappeare and
i don't know why.

You can write a small .c where in a thread the program change a part of the
GUI or you can tell to me what use insted the thread.
Maybe will be better.

Thanks

2007/11/20, Michael Lamothe < michael lamothe gmail com>:
Hi Alberto,

Sorry, I've accidentally not replied to all.  But to punish myself for
doing this again I'll answer your question myself.

In general, what happens when you write a multi-threaded application
(that is not multi-thread safe) you'll see unpredictable results.
Sometimes you will see a bug, but change a line of unrelated code and
the bug will disappear.  Usually the bug will just manifest itself in
other ways.  This is what I think is happening to you.  UI lock-ups
are a classic sign of a non-multithread safe application.

I can debug your application but I am going to make a recommendation to
you,

    Do not update the UI from any other thread other than the main thread!

Take my advice, or leave it, either way I will help you but it's
easier to change your application now, in its infancy, rather than
later.

Typically, multi-threaded applications are really hard to debug
because the offending code is related to the way the whole application
is written.  Do you have a SVN repository or a tarball that you can
send me?

Thanks,

Michael


On 20/11/2007, alberto barbaro < khlero83 gmail com> wrote:
Now until the various functions works the GUI don't responde and stay in
a
gray state.
How can I resolv it?
Thanks


2007/11/20, alberto barbaro < khlero83 gmail com>:
Well now it works.
Thanks to all.


2007/11/20, alberto barbaro < khlero83 gmail com>:

yes.
gdk_threads_enter()
function();
gdk_threads_leave()

Have you a complete example? Only a small piace of code where there
is
an GUI's update.

Thanks


2007/11/20, Michael Lamothe < michael lamothe gmail com>:

Are you locking with gdk_threads_enter/leave()?

Thanks,

Michael

On 20/11/2007, alberto barbaro <khlero83 gmail com> wrote:
Hi. I'm trying to develop a small application.

Problem:

I have a table with some buttons. I pass the pointer to the
table in
a
thread, in that thread i would update the table with a some new
buttons. The
buttons will appeare but are not 'clickable'! Why? if I try
return
thay
works but with the mouse no. Someone can help me?

Thanks
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org


http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list














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