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

Re: gtk+ doesn't work with pthreads



Am Mon, 31 Mai 1999 schrieb Christopher T. Lansdown:
> Uwe,
> 	Ok, what version of gtk+ are you using?  I think that thread
> safeness (if Gtk+ is actually thread-safe now) was introduced in the 1.2
> series, and possibly not 1.2.0.

Oooo, I just focussed on libc and kernel versioning but forget gtk+ ...
I am using 1.2.3 and XFree86 3.3.3 for libc5 installed by myself from the
website. (I have started with a SuSE from 1985 upgrading it by myself, so
nearly nothing from the start system is there)

and to bring two answers together:
Emmanuel wrote:
> Since X is not thread-safe, gtk is not too. In order to avoid
> the classic 'x io erro', you should make sure that only *one*
> thread manage the gui a time (do just like you want - mutexes,
> of simply a gui thread...). 

O.k. thats very clear. But I don't use threads!!! Just link with -lpthread
(namely as a test the testgtk: only added `glib-config --libs gthread` to
testgtk_LDADD) and testgtk bombs out in gtk_main().

So behaves grip. I have commented out all pieces of code that uses threads but
leave the linkage in the makefile. ldd shows libgthread and libpthread.

> 	As far as maximizing goes, what you're asking about is purely a
> window manager function.  If you have special needs, you could always
> figuring out the right size and hardcode that into a
> gtk_widget_set_usize() call, or ask the user for the right size and then
> just use that as a config paramter.  There's no good way from inside the
> widget set, unless I'm very much mistaken.

But there are ways to signal the window-manager my wishes from inside an
application, like for iconifying or positioning.  Is there no chance to give a
hint for maximizing the window???

> 	As far as figuring out optimzal geometry, I suggest making config
> options that the user can specify, because there is no one right size - it
> depends on what the user wants.  So let the user specify. :-) > 	-Chris
> 

I don't think so.  I have a vbox (scrolled_window) with a variable line-count
(the number doesn't change while the programm is running only at startup) and I
want the widget be as small as possible or of fixed size.  Say I have the place
for 8 lines. When I have to display 5 lines I want the widget of size 5, but
with 10 lines I do want it of size 8 (and the scrollbar appear).

Uwe

--
mailto:koloska@rcs.urz.tu-dresden.de
http://rcswww.urz.tu-dresden.de/~koloska/
--                                    --
right now the web page is in german only
but this will change as time goes by ;-)



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