Thanks Sascha and Flavio.<br><br><br>a)<br>I modified the code to ::<br><br>####################################################################################<br>    def __favorite_set_data_cb(self, column, cell, tree_model, tree_iter):<br>

        favorite = tree_model[tree_iter][ListModel.COLUMN_FAVORITE]<br><br>        if favorite:<br>            client = gconf.client_get_default()<br>            color = XoColor(client.get_string('/desktop/sugar/user/color'))<br>

            cell.props.xo_color = color<br>        else:<br>            cell.props.xo_color = None<br><br>        <VAR>.get_property('window').invalidate_rect(<VAR>.get_allocation(), False)<br>        <VAR>.get_property('window').process_updates(True)<br>
####################################################################################<br><br>where I tried with values of <VAR> to ::<br><br>                          *  self<br>                          *  self.tree_view<br>
<br>However, it made no difference.<br><br><br><br><br>b)<br>
I modified the code to ::<br>
<br>
####################################################################################<br>
    def __favorite_set_data_cb(self, column, cell, tree_model, tree_iter):<br>

        favorite = tree_model[tree_iter][ListModel.COLUMN_FAVORITE]<br>
<br>
        if favorite:<br>
            client = gconf.client_get_default()<br>
            color = XoColor(client.get_string('/desktop/sugar/user/color'))<br>

            cell.props.xo_color = color<br>
        else:<br>
            cell.props.xo_color = None<br>
<br>
        <VAR>.get_property('window').invalidate_rect(<VAR>.get_allocation(), True)<br>
        <VAR>.get_property('window').process_updates(True)<br>
####################################################################################<br>
<br>
where I tried with values of <VAR> to ::<br>
<br>
                          *  self<br>
                          *  self.tree_view<br>
<br>
However, it caused an infinite recursive loop, and the journal never loaded.<br><br><br><br><br>c)<br>
I modified the code to ::<br>
<br>
####################################################################################<br>
    def __favorite_set_data_cb(self, column, cell, tree_model, tree_iter):<br>

        favorite = tree_model[tree_iter][ListModel.COLUMN_FAVORITE]<br>
<br>
        if favorite:<br>
            client = gconf.client_get_default()<br>
            color = XoColor(client.get_string('/desktop/sugar/user/color'))<br>

            cell.props.xo_color = color<br>
        else:<br>
            cell.props.xo_color = None<br>
<br>
        <VAR>.get_property('window').invalidate_rect(<VAR>.get_allocation(), False)<br>
        <VAR>.get_property('window').process_updates(True)<br>
####################################################################################<br>
<br>
where I tried with values of <VAR> to ::<br>
<br>
                          *  column<br>
                          *  cell<br>
<br>
However, it caused the following traceback ::<br><br>Traceback (most recent call last):<br>  File "/home/ajay/sugar-jhbuild-dx3/install/lib/python2.7/site-packages/jarabe/journal/listview.py", line 329, in __favorite_set_data_cb<br>
    column.get_property('window').invalidate_rect(column.get_allocation(), False)<br>TypeError: object of type `GtkTreeViewColumn' does not have property `window'<br><br><br><br><br>d)<br>

I modified the code to ::<br>

<br>

####################################################################################<br>

    def __favorite_set_data_cb(self, column, cell, tree_model, tree_iter):<br>


        favorite = tree_model[tree_iter][ListModel.COLUMN_FAVORITE]<br>

<br>

        if favorite:<br>

            client = gconf.client_get_default()<br>

            color = XoColor(client.get_string('/desktop/sugar/user/color'))<br>


            cell.props.xo_color = color<br>

        else:<br>

            cell.props.xo_color = None<br>

<br>

        <VAR>.get_property('window').invalidate_rect(<VAR>.get_allocation(), True)<br>

        <VAR>.get_property('window').process_updates(True)<br>

####################################################################################<br>

<br>

where I tried with values of <VAR> to ::<br>

<br>

                          *  column<br>

                          *  cell<br>

<br>

Same as before - it caused the following traceback ::<br>
<br>
Traceback (most recent call last):<br>
  File 
"/home/ajay/sugar-jhbuild-dx3/install/lib/python2.7/site-packages/jarabe/journal/listview.py",
 line 329, in __favorite_set_data_cb<br>
    column.get_property('window').invalidate_rect(column.get_allocation(), False)<br>
TypeError: object of type `GtkTreeViewColumn' does not have property `window'<br><br><br><br>:-\<br><br><br><br>Regards,<br>Ajay<br><br><br>                          <br><br><div class="gmail_quote">On Tue, Jul 31, 2012 at 7:07 AM, Flavio Danesse <span dir="ltr"><<a href="mailto:fdanesse@gmail.com" target="_blank">fdanesse@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>self.get_property('window').invalidate_rect(self.get_allocation(), True)</div><div>self.get_property('window').process_updates(True)</div>
<div><br></div><div><br></div><div><br></div><br><div class="gmail_quote">
2012/7/30 Sascha Silbe <span dir="ltr"><<a href="mailto:silbe@activitycentral.com" target="_blank">silbe@activitycentral.com</a>></span><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><div class="h5">
<div>Ajay Garg <<a href="mailto:ajay@activitycentral.com" target="_blank">ajay@activitycentral.com</a>> writes:<br>
<br>
>> [adding short-circuit logic to<br>
>> jarabe.journal.listview.BaseListView.refresh()]<br>
</div>[...]<br>
<div>>> What we should do is enhancing the logic to<br>
>><br>
>> a) just redraw instead of querying the back-end again for changes we<br>
>>    triggered ourselves and / or<br>
>> b) update our model based on the change notifications rather than<br>
>>    throwing away our state.<br>
>><br>
><br>
> Well, that's exactly what I did, via the patch<br>
> <a href="http://git.sugarlabs.org/dextrose/mainline/commit/ad3897946e013f1ff4020aeab35375ccb122758b" target="_blank">http://git.sugarlabs.org/dextrose/mainline/commit/ad3897946e013f1ff4020aeab35375ccb122758b</a><br>


<br>
</div>Not really AFAICT. You're still inhibiting the refresh completely,<br>
without doing a redraw. You're also doing a gratuitous data store query<br>
for each favourite star. I'm expecting that to have considerable impact<br>
on performance.<br>
<div><br>
<br>
> I guess, if we could somehow cause the mouse to PROGRAMMATICALLY<br>
> hover-away/disappear-momentarily when the star/favorite-icon is clicked, we<br>
> could be done.<br>
> However, I am not able to find a way to do this via pygtk.<br>
<br>
</div>Fortunately. :-P<br>
<br>
As discussed on IRC, the way to _trigger_ _a_ _redraw_ (not: move the<br>
pointer) is something like this:<br>
<br>
    x_, y_, width, height = self.allocation<br>
    area = (0, 0, width, height)<br>
    self.window.invalidate_rect(area, False)<br>
<div><div><br>
<br>
Sascha<br>
--<br>
<a href="http://sascha.silbe.org/" target="_blank">http://sascha.silbe.org/</a><br>
<a href="http://www.infra-silbe.de/" target="_blank">http://www.infra-silbe.de/</a><br>
</div></div><br></div></div><div class="im">_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org" target="_blank">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
<br></div></blockquote></div><br>
</blockquote></div><br>