[Gtk-sharp-list] Newbie's TreeView updates *very* slowly

christian.hergert at gmail.com christian.hergert at gmail.com
Wed Dec 24 17:21:19 EST 2008


Updates to the widget do not happen synchronously. Please make sure  
your "Intense Database Query" is done within a thread so that gtk can  
continue to draw from its main loop when the tree model is updated.

If you get to the point where you are doing thousands of additions to the  
model, you may want to consider removing the model from the treeview, doing  
the updates, and then re-attaching the model. This will speed up the UI  
because many of the model events (such as row added) do not need to be  
handled by the treeview.

-- Christian

On Dec 24, 2008 12:43pm, Andy Selvig <ajselvig at gmail.com> wrote:
> Try calling QueueDraw() after the ShowAll() on the tree view. ShowAll()  
just makes sure everything is visible, but Gtk will wait until the  
application is idle before it redraws.
>
> On Tue, Dec 23, 2008 at 3:32 PM, fourthirtysix fourthirtysix at yahoo.com>  
wrote:
>
>
>
> Hello, I should first disclose that I'ma very novice programmer working on
>
> my first GUI app ever!
>
>
>
> I have an app using a TreeView/TreeStore to display a table with 8 columns
>
> and about 5 rows.
>
>
>
> The program loads with a blank window. I click on one button, and 3 of  
the 8
>
> columns are populated with data for all 5 rows.
>
>
>
> Next, I click a second button, and for each of the 5 rows, an intensive
>
> database routine is performed to get data to update the rest of the empty
>
> places in each row.
>
>
>
> I iterate through a list of the five rows, running the database search
>
> seperately for each one and using the TreeView Models SetValue function to
>
> update each row. I call treeview.ShowAll() for each iteration to do the
>
> refresh.
>
>
>
> My problem is: The treeview is supposed to update each time a result is
>
> found (5 times in total, one for each row). I do this to show the user  
that
>
> progress is being made. Unfortunately, both the data and that statusbar
>
> functions that I am calling wait until all of the intensive data searches
>
> are done before refreshing.
>
>
>
> Basically, it waits until everything is done, and then refreshes. Is GTK
>
> just slow? is it Mono? Is there a way to get the screen to refresh even
>
> though I'm running a heavy load operation between refreshes?
>
>
>
> help!
>
>
>
> thanks :-D
>
> -mwp
>
> --
>
> View this message in context:  
http://www.nabble.com/Newbie%27s-TreeView-updates-*very*-slowly-tp21151505p21151505.html
>
>
> Sent from the Mono - Gtk# mailing list archive at Nabble.com.
>
>
>
> _______________________________________________
>
> Gtk-sharp-list maillist - Gtk-sharp-list at lists.ximian.com
>
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/gtk-sharp-list/attachments/20081224/7bf0bf25/attachment-0001.html 


More information about the Gtk-sharp-list mailing list