Opened 6 years ago

Closed 6 years ago

#9684 closed defect (fixed)

wxListbook scrollbar space remains on page deletion

Reported by: crjjrc Owned by:
Priority: normal Milestone: 2.8.9
Component: GUI-generic Version: 2.8.x
Keywords: wxListbook wxListCtrl Cc:
Blocked By: Blocking:
Patch: yes

Description

To see the problem, run the notebook sample, add pages with Alt-A until scrollbars appear, select the Maximized Button page, and hit Alt-D to delete the page. This page has the longest label, but when it's removed, the list control isn't resized immediately. It is resized on the next page selection. I believe the resize should happen immediately.

A fix is to unconditionally issue a size event after the page has been removed in wxListbook::DoRemovePage(). This is currently done conditionally when all pages have been removed. I'm attaching a patch that removes the condition.

This problem is present in both trunk and wx2.8.8. The patch is for trunk, but the fix can be trivially applied to wx2.8.8. I've tested it on GTK and OS X. In addition to fixing the scrollbar spacing problem, it also fixes some repaint problems in OS X that occurred when the list control narrowed (which a simple change in selection did not fix).

  • Chris

Attachments (1)

listbkg_sizing.patch download (537 bytes) - added by crjjrc 6 years ago.
Removes scrollbar space that lingers after notebook pages removed

Download all attachments as: .zip

Change History (2)

Changed 6 years ago by crjjrc

Removes scrollbar space that lingers after notebook pages removed

comment:1 Changed 6 years ago by vadz

  • Resolution set to fixed
  • Status changed from new to closed

I think there should be a better way to relay out things correctly other than generating a dummy size event but whatever we do we definitely do need to do it after removing any page, not just the last one, so your patch is correct, thanks!

I've committed it as part of r54605.

Note: See TracTickets for help on using tickets.