[pygtk] Gtk.Notebook problem in PyGTK 2.6

I think this might be a matplotlib issue.

I’ve been having some refresh issues with matplotlib since switching to
2.6. In particular I’ve noticed that if I put my mouse over the
toolbar and let a tooltip pop up the canvas does not get repainted.

Up to now I’d been assuming this problem was isolated to me (I use
ratpoison as a window manager, which can confuse some apps).

I’ve cc’ed the matplotlib list in case anyone can throw some light on
this.

John

dimitri pater wrote:

···

pygtk@…85…http://www.daa.com.au/mailman/listinfo/pygtkhttp://www.async.com.br/faq/pygtk/

Yes, this could could very well be a matplotlib issue. I will try to do some tests, thanks for cc’ing it to the matplotlib list.

Dimitri

···

On 5/31/05, John Gill <jng@…640…> wrote:

I think this might be a matplotlib issue.

I’ve been having some refresh issues with matplotlib since switching to
2.6. In particular I’ve noticed that if I put my mouse over the
toolbar and let a tooltip pop up the canvas does not get repainted.

Up to now I’d been assuming this problem was isolated to me (I use
ratpoison as a window manager, which can confuse some apps).

I’ve cc’ed the matplotlib list in case anyone can throw some light on
this.

John

dimitri pater wrote:

Hello,

I upgraded to PyGTK 2.6 from 2.4 . Now, when I switch from page 2 on a
Gtk.Notebook back to page 1, page 1 still shows some elements from page
2 (it is not refreshed, just some parts). Both pages contain graphs
created with Matplotlib. I never had problems like this with 2.4…

Any clues somebody? If necessary, I will attach the source files.

Best regards,

Dimitri



---


_______________________________________________
pygtk mailing list
pygtk@...85...
[http://www.daa.com.au/mailman/listinfo/pygtk](http://www.daa.com.au/mailman/listinfo/pygtk)
Read the PyGTK FAQ: [http://www.async.com.br/faq/pygtk/](http://www.async.com.br/faq/pygtk/)


Please visit dimitri’s website: www.serpia.com

dimitri pater schrieb:

Yes, this could could very well be a matplotlib issue. I will try to do some tests, thanks for cc'ing it to the matplotlib list.

Dimitri

    I think this might be a matplotlib issue.

    I've been having some refresh issues with matplotlib since
    switching to 2.6. In particular I've noticed that if I put my
    mouse over the toolbar and let a tooltip pop up the canvas does
    not get repainted.

    Up to now I'd been assuming this problem was isolated to me (I use
    ratpoison as a window manager, which can confuse some apps).

    I've cc'ed the matplotlib list in case anyone can throw some light

    Hello,
    I upgraded to PyGTK 2.6 from 2.4 . Now, when I switch from page 2
    on a Gtk.Notebook back to page 1, page 1 still shows some
    elements from page 2 (it is not refreshed, just some parts). Both
    pages contain graphs created with Matplotlib. I never had
    problems like this with 2.4...
    Any clues somebody? If necessary, I will attach the source files.

    Best regards,
    Dimitri

------------------------------------------------------------------------

_______________________________________________
pygtk mailing list pygtk@…85… <mailto:pygtk@…85…>
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

--
Please visit dimitri's website: www.serpia.com <http://www.serpia.com>

I can confirm this (mis)behaviour with matplotlib 0.80 and gtk+/pygtk 2.6. I had wanted to look into this matter, but didn't yet have time to do it. A simple guess would be that the expose-event is not handled properly by the GTK backend.

I noticed the problem when I put a menu-bar over a matplotlib GTK Canvas. When you leave an opened menu, the menu will not disappear.

Niklas.

···

On 5/31/05, *John Gill* <jng@…81… > <mailto:jng@…81…>> wrote:
    on this. > > John > > dimitri pater wrote:

[...]

    I think this might be a matplotlib issue.

    I've been having some refresh issues with matplotlib since
    switching to 2.6. In particular I've noticed that if I put my
    mouse over the toolbar and let a tooltip pop up the canvas does
    not get repainted.

    Up to now I'd been assuming this problem was isolated to me (I use
    ratpoison as a window manager, which can confuse some apps).

    I've cc'ed the matplotlib list in case anyone can throw some light
    on this.

    John

[...]

I can confirm this (mis)behaviour with matplotlib 0.80 and gtk+/pygtk 2.6. I had wanted to look into this matter, but didn't yet have time to do it. A simple guess would be that the expose-event is not handled properly by the GTK backend.

I noticed the problem when I put a menu-bar over a matplotlib GTK Canvas. When you leave an opened menu, the menu will not disappear.

Niklas.

I have started looking at the code and did not quite understand what I found:

backends/backend_gtk.py has a class FigureCanvasGTK. Its method 'expose_event' is responsible for redrawing.
In the situation I described, when I leave an opened menu that overlaps the graph, the expose_event is properly called, but the widget is not redrawn. If DBL_BUFFER is set (which it is), the widget is only redrawn, if self._draw_pixmap is set to True. Of course, this variable is not set to True when GTK closes a menu but only when matplotlib requests a redraw. So, in conclusion, no redraw happens.

After consulting the PyGTK reference I tried to reactivate double buffering, which is turned of in the backend_gtk.py by the command

self.set_double_buffered(False)

I wonder why you set this? Do you want to provide your own double buffering? Why? If you set this value to True, everything will be fine.

Best regards,

Niklas Volbers.

···

On 5/31/05, *John Gill* <jng@…81… >> <mailto:jng@…81…>> wrote:

I made a small test app which clearly shows that Matplotlib 0.8 and PyGTK 2.6 don’t work well together. No problem in PyGTK 2.4

bye,
Dimtiri

testMPL-GTK.py (1.79 KB)

project1.glade (7.18 KB)

···

On 6/1/05, N. Volbers <mithrandir42@…273…> wrote:

dimitri pater schrieb:

Yes, this could could very well be a matplotlib issue. I will try to
do some tests, thanks for cc’ing it to the matplotlib list.

Dimitri

On 5/31/05, John Gill < > jng@…81… > > mailto:jng@...81...> wrote:

I think this might be a matplotlib issue.
I've been having some refresh issues with matplotlib since
switching to 2.6.  In particular I've noticed that if I put my
mouse over the toolbar and let a tooltip pop up the canvas does
not get repainted.

Up to now I'd been assuming this problem was isolated to me (I use
ratpoison as a window manager, which can confuse some apps).

I've cc'ed the matplotlib list in case anyone can throw some light
on this. > > > >     John > > > >     dimitri pater wrote:
Hello,
I upgraded to PyGTK 2.6 from 2.4 . Now, when I switch from page 2
on a Gtk.Notebook back to page 1, page 1 still shows some
elements from page 2 (it is not refreshed, just some parts). Both
pages contain graphs created with Matplotlib. I never had
problems like this with 2.4...
Any clues somebody? If necessary, I will attach the source files.

Best regards,
Dimitri


pygtk mailing list
pygtk@…85… <mailto:pygtk@…85…

http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ:
http://www.async.com.br/faq/pygtk/


Please visit dimitri’s website: www.serpia.com <http://www.serpia.com>

I can confirm this (mis)behaviour with matplotlib 0.80 and gtk+/pygtk
2.6. I had wanted to look into this matter, but didn’t yet have time to
do it. A simple guess would be that the expose-event is not handled

properly by the GTK backend.

I noticed the problem when I put a menu-bar over a matplotlib GTK
Canvas. When you leave an opened menu, the menu will not disappear.

Niklas.


Please visit dimitri’s website: www.serpia.com