Re: Loading treestore after gtk.main()?
ke, 2009-10-28 kello 16:55 -0700, Daniel B. Thurman kirjoitti: > How is it possible to bring up the gtk window first, > before loading your treestore, which might take > a long time? I am not sure from your problem description which aspect is most troublesome for you, so I'll answer both I can think of. First, if it is going to take a long time, how are you intending to do it without the user interface freezing? There are two common approaches: either background threads or idle handlers. With background threds you start a new thread, it does whatever it needs to collect the data and add it to the treestore. This brings on all the problems of thread programming: you'll need to handle locking carefully, crashes are possibly inevitable and certainly mysterious, etc. In the idle handler case you register a callback with g_idle_add. The main loop calls the handler whenever it doesn't have anything better to do. The handler needs to do a little bit of work at a time, and then return; otherwise it freezes the main loop until it is done. In other words, the handler does not run in its own thread. The benefit is avoidance of threading related complexity, and the drawback is that it'll be slower. Second, to trigger threads or register idle handlers, you may be able to do this before calling gtk_main, or you can connect to the main window's map-event signal and trigger things from there. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Loading treestore after gtk.main()?
How is it possible to bring up the gtk window first, before loading your treestore, which might take a long time? ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Deadlock/Freeze
Hi all, I'm working on an application used for displaying news (taken from internet) and spot-movies (using gstreamer). In the short term usage, everything is ok, but when I leave the application running for several hours, it ends freezing. How is it possible to create deadlock? In theory everything should be serialized in the gtk main loop, so there would not be any concurrency at all. The only thing that leaves me in doubts, is the interaction with gstreamer, even thought I called gobject.threads_init() before the gtk.main_loop() callback. >From the FAQ entry [1] it seems I need to enter/leave threads inside each timeout callback. Could the procedure described be a valid solution for my problem? Thanks in advance. [1] http://faq.pygtk.org/index.py?req=edit&file=faq20.015.htp -- Matteo Landi http://www.matteolandi.net/ ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
setting the attachment point when adding one container to another
Hi, First here is a small excerpt from my code: http://pastebin.com/m31e6a3c8 The problem is that when text is set, the beginning of the text is hidden instead of the ending. Here is a screen: http://img39.imageshack.us/img39/4592/screenshot1tm.png In this case I want that it would show "Power Of" instead of "ower Off". Now it cuts the beginning and I want that it would cut the ending. Is it possible to do that without increasing the adjustment? The viewport should be scrollable and workaround with initial adjustment doesn't look good :| Any help is really appreciated! ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list