wxNotebook RemovePage problem

Just Rob wrote:

Hello,

After using RemovePage in a wxNotebook the page gets removed but
the tab stays. I've noticed this in my app and other people's (Pysoulseek for example).
Is there something I can do to fix this? I get this in wxPython 2.4.0.2 and 2.4.0.7, wxGTK version.

If I manually resize the window with the mouse it disappears.

Sample code? Does it still happen with 2.4.1.2?

Yes, I just tried 2.4.1.2, so I think its something I'm (not?) doing.

I simply call self.nb.RemovePage(self.nb.GetSelection())
I'm not sure if I need to do anything else. I tried .Refresh() on self (the panel) and
self.nb, but neither helped.

Try changing the selection to another page first.

I tried. No luck using 2.4.1.2 using this code:

p = self.nb.GetSelection()
self.nb.SetSelection(p - 1)
self.nb.RemovePage(p)

The demo removes pages when switching between the samples but I've never seen this problem there. Perhaps something on your machine you are using could be causing this problem? (Some rogue libraries, the gtk theme, etc.) Try removing your ~/.gtkrc* files and see if that makes a difference.

I'm running KDE and it was creating a .gtkrc file for me. I turned that option off in the Control Center.
That didn't solve it. I went through the 2.4.0.7 demo and I get the problem in specific examples
every time. For example under Core Windows/Controls if I click on wxNotebook, then click on
wxMenu the tab doesn't get erased.

I came up with a kludge though:

  self.nb.SetSelection(p-1)
  self.nb.RemovePage(p)
   x,y = self.GetSize()
   self.SetSize(wxSize(x+1, y))

Since resizing the entire application with my mouse always erased the tab, I thought of trying
that, and sure enough it works.

I'm using Gentoo Linux, by the way. Anyone else with Gentoo notice this notebook tab problem?

Thanks

ยทยทยท

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail