Re: GUI freeze and long blocking operation
On 12 June 2013 01:52, Kip Warner k...@thevertigo.com wrote: My GtkAssistant on one page in particular performs a long operation which would otherwise block the GUI from refreshing, if it were not for intermittent... while Gtk.events_pending(): Gtk.main_iteration() To start the long work, the prepare signal is captured in my assistant and the long job (startDiscVerification()) method is enqueued via GObject.idle_add() in the onPrepare() method. Do you need to use idle_add()? I have a Progress class I use to draw a progress bar on the screen and show a spinner and all that. It does the while pending / iterate thing too. My code looks something like: init: photo = gtk.Button('RTI Capture ...') photo.connect('clicked', self.rti_capture_cb, None) rti_capture_cb: mark gui insensitive enable progress feedback while long_job(): do a bit of work self.progress.update(percent) hide progress feedback mark gui active again Code here, if it's any help: https://github.com/jcupitt/rtiacquire John ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Prevent sort of GtkListStore.
With gtk_tree_view_column_set_sort_column_id (), it appears that GtkListStore also gets sorted. I don't want that to happen, since the data in it has to be compared. How can I do this? Thanks!! ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Prevent sort of GtkListStore.
I'm not sure what's the GTK equivalent, but in gtkmm (the C++ binding) it's possible to give a TreeView separate sorting which doesn't affect the data, and have multiple Views to sort the same TreeStore using different columns. I assume it's possible for ListStore too. The GTK API ref / tutorial probably mentions that where it explains sorting. I hope that helps, a bit of digging there will probably get you what you're looking for... Anatoly On ד', 2013-06-12 at 20:08 +0530, dE wrote: With gtk_tree_view_column_set_sort_column_id (), it appears that GtkListStore also gets sorted. I don't want that to happen, since the data in it has to be compared. How can I do this? Thanks!! ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Prevent sort of GtkListStore.
On 06/12/13 21:24, אנטולי קרסנר wrote: I'm not sure what's the GTK equivalent, but in gtkmm (the C++ binding) it's possible to give a TreeView separate sorting which doesn't affect the data, and have multiple Views to sort the same TreeStore using different columns. I assume it's possible for ListStore too. The GTK API ref / tutorial probably mentions that where it explains sorting. I hope that helps, a bit of digging there will probably get you what you're looking for... Anatoly On ד', 2013-06-12 at 20:08 +0530, dE wrote: With gtk_tree_view_column_set_sort_column_id (), it appears that GtkListStore also gets sorted. I don't want that to happen, since the data in it has to be compared. How can I do this? Thanks!! ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list There's some mention of gtk_tree_sortable_set_sort_column ( ) in GtkTreeViewColumn documentation, but there's no mention of it anywhere else. While compiling, this function is not found. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Prevent sort of GtkListStore.
I'll tell you what I do when I encounter this kind of problem. This is a general purpose technique for finding answers for things not well documented. If you made a web-search and there's no helpful tutorial and nothing on the mailing list archives, here's what you can do The gtkmm book provides a short explanation. In most cases it's quite easy to find the GTK functions corresponding to gtkmm ones. Here's the gtkmm book page about TreeView Sorting: https://developer.gnome.org/gtkmm-tutorial/unstable/sec-treeview-sort.html.en If it doesn't help - maybe function name differ from GTK ones - go to the gtkmm source code and find the implementation. But most of gtkmm is auto-generated, so you need to see the source after gmmproc is applied. You can do it manually or simply download the gtkmm source with gmmproc applied, directly from here: http://fossies.org/linux/privat/gtkmm-3.8.1.tar.gz/ Then go to the definition of the gtkmm methods you need, and see which treeview GTK method is used. Then just go to its API documentation. Very often digging like that is the only way. Anatoly On ד', 2013-06-12 at 23:15 +0530, dE wrote: On 06/12/13 21:24, אנטולי קרסנר wrote: I'm not sure what's the GTK equivalent, but in gtkmm (the C++ binding) it's possible to give a TreeView separate sorting which doesn't affect the data, and have multiple Views to sort the same TreeStore using different columns. I assume it's possible for ListStore too. The GTK API ref / tutorial probably mentions that where it explains sorting. I hope that helps, a bit of digging there will probably get you what you're looking for... Anatoly On ד', 2013-06-12 at 20:08 +0530, dE wrote: With gtk_tree_view_column_set_sort_column_id (), it appears that GtkListStore also gets sorted. I don't want that to happen, since the data in it has to be compared. How can I do this? Thanks!! ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list There's some mention of gtk_tree_sortable_set_sort_column ( ) in GtkTreeViewColumn documentation, but there's no mention of it anywhere else. While compiling, this function is not found. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: GUI freeze and long blocking operation
On Wed, 2013-06-12 at 09:50 +0100, jcup...@gmail.com wrote: Do you need to use idle_add()? Hey John, If I start the long job function from within my assistant's prepare signal callback, as opposed to en-queueing it there via idle_add(), then the GUI doesn't refresh throughout the duration of the long job. This happens even though I do pump the message queue during the long job via the usual... while Gtk.events_pending(): Gtk.main_iteration() Thanks a lot for your help. -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list