English 中文(简体)
将滚动屏障添加到面积
原标题:Adding scrollbar to sizer

I m using wxPython 2.8 and i m trying to add scrollbar capabilities on the right side of a wx.Frame. This "right side" is a sizer; i have tried to use wx.ScrolledWindow but it seems to work only on wx.Frame. Do i have to add a wx.Panel on the client of the scrollbar ? How ? Is there an example ?

这是一部法典,其中一造“右”尺寸:

btnSizer = wx.GridSizer(6,num_art_per_riga)

for elemento in lista_elementi:
    self.button = MyButton(self.scroll, elemento.descrizionebreve, elemento.descrizione, is_articolo)

    self.button.Bind(wx.EVT_BUTTON , self.aggiungi_su_listbox)
    btnSizer.Add(self.button, proportion=0, flag=wx.ALIGN_LEFT|wx.EXPAND, border=0)
btnSizer.Layout()     

box = wx.StaticBox(self.scroll, -1, descrizione_box)
staticSizer = wx.StaticBoxSizer(box, wx.VERTICAL)
staticSizer.Add(btnSizer)
self.toolbar.Add(staticSizer)      # this is the sizer at the right side

self.scroll.SetVirtualSize((600, 400)) #this is the scroll !

Using this example the "toolbar" isn t displayed, nothing appears. The scroll is created using the following constructor:

 self.scroll = wx.ScrolledWindow(self, -1)

如果自食不果。 小组。

感谢任何帮助

最佳回答

Try using a ScrolledPanel, it s a "better" ScrolledWindow.
(And make sure you assign the sizer to the panel)

问题回答

为了回答你的问题之一,有许多例子。 下载WxPython Docs和Demos,你将举几个例子。





相关问题
Horizontal Step Carousel

Step Carousel http://www.harrods.com/harrodsstore/ I need a flash or jquery Horizontal Step Carousel which has auto scroll feature and scrollbar at the bottom. Anyone saw it something like that?

How to show scrollbar in Swing s JOptionPane.showOptionDialog?

In our Swing application, we show error messages using JOptionPane.showOptionDialog. However, some of the messages are long and we would like to limit the height of the dialog and show a scrollbar. We ...

Mouse events on an SWT Scrollbar

Using standalone SWT Scrollbars is something of a hack (using this workaround), but it can be done. Here s a snippet: ScrolledComposite scrolledComposite = new ScrolledComposite( ...

Populating a DataGridView on-the-fly (VB.NET)

I have a DataGridView which reads data from a custom (CSLA) list object. The dataset might have 100,000 records, and obviously I don t want to show them all at once because, for one, it would take ...

set scrollbar properties in firefox

I want to set the color of my scrollbar and for it to work in firefox as well. I read that scrollbar s are not part of the w3c standard and therefore their customizing are not supported in firefox. ...

How to catch scrolling event in DBGrid in Delphi

I have a DBGrid, I need to run some code, each time the horizontal scrollbar is used. I couldn t find such event in DBGrid. Can you advise something?

热门标签