ScrolledPanel with vertical scrollbar only and WrapSizer

后端 未结 2 1844
梦谈多话
梦谈多话 2021-01-14 03:08

I uses a WrapSizer in order to have an automatic layout (as thumbnail gallery) like this (see screenshot on the left) :

2条回答
  •  粉色の甜心
    2021-01-14 03:39

    It looks like you just forgot to include

    self.SetSizer(sizer)
    

    Since the WrapSizer takes the whole frame, I think that will work. Also, instead of SetupScrolling, you can use

    self.SetScrollRate(horiz, vert)
    

    to specify the increment (in pixels, i think) of the scroll, and that should work.

    I can't test it here right now though, and WrapSizers are a little weird - they sometimes have trouble figuring out their proper size. You may need to wrap it in a BoxSizer going the other direction.

提交回复
热议问题