Re: [pygtk] How to momentarily-hover-away / momentarily-disappear-mouse from over the gtk.GenericCellRenderer ?

2012-08-13 Thread Ajay Garg
Hi Bjartur.
Found a simple way to do it :)

I just hide, then unhide the window.
Simple, elegant and effective. :)


Thanks a ton for your help.

Thanks and Regards,
Ajay


On Mon, Jul 30, 2012 at 4:05 AM, Bjartur Thorlacius wrote:

> On Sun, 29 Jul 2012 15:32:46 +0530
> Ajay Garg  wrote:
>
> > I am using a "gtk.TreeViewColumn" + "gtk.CellRenderer" +
> > "set_cell_data_func" paradigm.
> >
> > I googled, and the link
> > https://mail.gnome.org/archives/gtkmm-list/2009-June/msg00071.html
> > seems to suggest that the "set_cell_data_func" callback is called,
> > when the mouse cursor is moved away from the cell (which I suppose,
> > triggers the re-paint of the cell).
> >
> > Is it so? if yes, can the re-paint be triggered in some other manner?
> >
> According to my reading of
> http://developer.gnome.org/gtk/2.24/chap-drawing-model.html, yes it
> can. Widgets are to draw themselves in response to the expose-event
> signal. Try emitting expose-event on the object representing the
> widget. GObjects surely have a signal() method or some such.
>
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] How to momentarily-hover-away / momentarily-disappear-mouse from over the gtk.GenericCellRenderer ?

2012-07-29 Thread Bjartur Thorlacius
On Sun, 29 Jul 2012 15:32:46 +0530
Ajay Garg  wrote:

> I am using a "gtk.TreeViewColumn" + "gtk.CellRenderer" +
> "set_cell_data_func" paradigm.
> 
> I googled, and the link
> https://mail.gnome.org/archives/gtkmm-list/2009-June/msg00071.html
> seems to suggest that the "set_cell_data_func" callback is called,
> when the mouse cursor is moved away from the cell (which I suppose,
> triggers the re-paint of the cell).
> 
> Is it so? if yes, can the re-paint be triggered in some other manner?
> 
According to my reading of
http://developer.gnome.org/gtk/2.24/chap-drawing-model.html, yes it
can. Widgets are to draw themselves in response to the expose-event
signal. Try emitting expose-event on the object representing the
widget. GObjects surely have a signal() method or some such.
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] How to momentarily-hover-away / momentarily-disappear-mouse from over the gtk.GenericCellRenderer ?

2012-07-29 Thread Bjartur Thorlacius
On Sun, 29 Jul 2012 15:32:46 +0530
Ajay Garg  wrote:

> I am using a "gtk.TreeViewColumn" + "gtk.CellRenderer" +
> "set_cell_data_func" paradigm.
> 
> I googled, and the link
> https://mail.gnome.org/archives/gtkmm-list/2009-June/msg00071.html
> seems to suggest that the "set_cell_data_func" callback is called,
> when the mouse cursor is moved away from the cell (which I suppose,
> triggers the re-paint of the cell).
> 
> Is it so? if yes, can the re-paint be triggered in some other manner?
> 
According to my reading of
http://developer.gnome.org/gtk/2.24/chap-drawing-model.html, yes it
can. Widgets are to draw themselves in response to the expose-event
signal. Try emitting expose-event on the object representing the
widget. GObjects 
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] How to momentarily-hover-away / momentarily-disappear-mouse from over the gtk.GenericCellRenderer ?

2012-07-25 Thread Ajay Garg
Thanks Bjartur, for the reply.

Bjartur, you could consider my use-case, similar to what happens in case of
a checkbox - the user clicks the checkbox (initially unchecked), by taking
over the mouse-pointer over the checkbox cell; and then the checkbox
reflects back the changed status on the UI (checked state).

The only caveat - this (the change from unchecked-to-checked state) happens
only after the mouse is hovered away from the checkbox-cell. There is no
visible status change on the UI (change from unchecked-to-checked state),
if the mouse-pointer is not hovered away, even though the user has clicked
the checkbox-cell, expecting spontaneous status change on the UI (change
from unchecked-to-checked state).

Regards,
Ajay

On Wed, Jul 25, 2012 at 6:09 PM, Bjartur Thorlacius wrote:

> On Wed, Jul 25, 2012 at 6:16 AM, Ajay Garg  wrote:
> > So, is there a way to programmatically momentarily-hover-away /
> > momentarily-disappear-mouse from over "cell_favorite" (or rather a
> > "gtk.GenericCellRenderer") ?
> You can warp the mouse pointer to wherever you want. Alternatively,
> you can use a 1x1 (possibly transparent) pixel cursor icon, as
> unclutter does IIRC. You might have to use GDK or XLib.
>
> Do you need to warp the mouse to trigger an event and invoke a
> function? If so, why not just invoke the function directly without
> messing with the user's cursor? The user expects the be under his
> control, most of the time.
>
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Re: [pygtk] How to momentarily-hover-away / momentarily-disappear-mouse from over the gtk.GenericCellRenderer ?

2012-07-25 Thread Bjartur Thorlacius
On Wed, Jul 25, 2012 at 6:16 AM, Ajay Garg  wrote:
> So, is there a way to programmatically momentarily-hover-away /
> momentarily-disappear-mouse from over "cell_favorite" (or rather a
> "gtk.GenericCellRenderer") ?
You can warp the mouse pointer to wherever you want. Alternatively,
you can use a 1x1 (possibly transparent) pixel cursor icon, as
unclutter does IIRC. You might have to use GDK or XLib.

Do you need to warp the mouse to trigger an event and invoke a
function? If so, why not just invoke the function directly without
messing with the user's cursor? The user expects the be under his
control, most of the time.
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


[pygtk] How to momentarily-hover-away / momentarily-disappear-mouse from over the gtk.GenericCellRenderer ?

2012-07-24 Thread Ajay Garg
Hi all.

I have a custom subclass of gtk.GenericCellRenderer, CellRendererFavorite.
This is encapsulated within a "gtk.TreeViewColumn".


I guess some code would make things clearer ::


154 cell_favorite = CellRendererFavorite(self.tree_view)
155 cell_favorite.connect('clicked',
self.__favorite_clicked_cb)

156
157 column = gtk.TreeViewColumn()
158 column.props.sizing = gtk.TREE_VIEW_COLUMN_FIXED
159 column.props.fixed_width = cell_favorite.props.width
160 column.pack_start(cell_favorite)
161 column.set_cell_data_func(cell_favorite,
self.__favorite_set_data_cb)
162 self.tree_view.append_column(column)




Now, in the callback function "__favorite_set_data_cb", some of the "props"
(icon-name, color, etc) are changed.
However, the UI effect takes place ONLY when the mouse is hovered away from
"cell_favorite".

So, is there a way to programmatically momentarily-hover-away /
momentarily-disappear-mouse from over "cell_favorite" (or rather a
"gtk.GenericCellRenderer") ?


Will be grateful for a reply.


Thanks and Regards,
Ajay
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/