wxPython in Action: Early Access Program

As our "wxPython in Action" book is going through the final stages of publication our publisher, Manning Press, will be making some chapters available through their Manning Early Access Program (MEAP). This enables you to buy the book in ebook (PDF) format and to get access to the finalized chapters as they become available. If you later decide to purchase the hard copy book then Manning will deduct the price of the ebook from the book's purchase price.

If you would like to purchase a subscription to the MEAP chapters or learn more about the wxPython in Action book you can do so by going to this page at Manning's website:

  http://www.manning.com/books/rappin

Announcements of new chapters becoming available, or other MEAP related info will be made here:

  http://www.manning-sandbox.com/forum.jspa?forumID=203

To learn more about MEAP, please read this page:

  http://www.manning.com/about/meap

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

If you later decide to purchase the hard copy book then Manning will deduct the price of the ebook from the book's purchase price.

I think I misunderstood something on Manning's website about MEAP that I need to clear up. If you wish to purchase just the ebook then you can do so at about half the cost of the printed book, and also and get the MEAP chapters as they become available. If you wish to purchase the printed book then if you get it direct form Manning at the full price then you can get the ebook and the MEAP chapters for no additional cost.

Sorry for the disinformation.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Hello everybody,

I'm starting with wxPyhton, but it is already frustrating me. I tried to figure out how the ScrolledPanel works, and I lost all day looking on the internet, at the demos and trying all sorts of things. I ended up with this basic example, and still couldn't get it to work properly. The ScrolledPanel won't display correctly. What am I doing wrong?

Any help is appreciated. Thank you very much.
Kind regards,
antoine

import wx
import wx.lib.scrolledpanel as scroll

class MyFrame(wx.Frame):
     def __init__(self):
         wx.Frame.__init__(self, None, title="MCM Email")
         mainsizer = wx.BoxSizer(wx.VERTICAL)
         formsizer = wx.FlexGridSizer(0, 2, vgap=10, hgap=10)

         spanel = scroll.ScrolledPanel(self, -1)
         spanel.SetSizer(formsizer)
         spanel.SetAutoLayout(1)
         spanel.SetupScrolling()

         for i in range(6):
             formsizer.Add(wx.StaticText(spanel, -1, 'hello'))

         mainsizer.Add(spanel)

         self.SetSizer(mainsizer)
         self.Fit()

         self.Show()
         self.Bind(wx.EVT_CLOSE, self.OnClose)

     def OnClose(self, evt):
         evt.Skip()

app = wx.App(0)
MyFrame()
app.MainLoop()

Hello Antoine,

    the problem does not come from ScrolledPanel, but from the sizers. In
the line:

mainsizer.Add(spanel)

You should specify to mainsizer which "layout" the ScrolledPanel should
have: in other words, you should specify if ScrolledPanel is allowed to
expand itself horizontally and/or vertically. By changing the line in this
way:

mainsizer.Add(spanel, 1, wx.EXPAND)

your sample works very well here (wxPython 2.6.2.1, Python 2.4.1, Windows
XP). I may suggest you to take a look on sizers overview on the Wiki:

http://wiki.wxpython.org/index.cgi/Getting_20Started#head-d6e1fea3b402afb9fa31fab9e8bcaa98477af268

HTH.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77

···

----- Original Message -----
From: "Antoine De Groote" <antoine@vo.lu>
To: <wxPython-users@lists.wxwidgets.org>
Sent: Wednesday, February 15, 2006 9:38 PM
Subject: [wxPython-users] ScrolledPanel mystery

Hello everybody,

I'm starting with wxPyhton, but it is already frustrating me. I tried to
figure out how the ScrolledPanel works, and I lost all day looking on
the internet, at the demos and trying all sorts of things. I ended up
with this basic example, and still couldn't get it to work properly. The
ScrolledPanel won't display correctly. What am I doing wrong?

Any help is appreciated. Thank you very much.
Kind regards,
antoine

import wx
import wx.lib.scrolledpanel as scroll

class MyFrame(wx.Frame):
     def __init__(self):
         wx.Frame.__init__(self, None, title="MCM Email")
         mainsizer = wx.BoxSizer(wx.VERTICAL)
         formsizer = wx.FlexGridSizer(0, 2, vgap=10, hgap=10)

         spanel = scroll.ScrolledPanel(self, -1)
         spanel.SetSizer(formsizer)
         spanel.SetAutoLayout(1)
         spanel.SetupScrolling()

         for i in range(6):
             formsizer.Add(wx.StaticText(spanel, -1, 'hello'))

         mainsizer.Add(spanel)

         self.SetSizer(mainsizer)
         self.Fit()

         self.Show()
         self.Bind(wx.EVT_CLOSE, self.OnClose)

     def OnClose(self, evt):
         evt.Skip()

app = wx.App(0)
MyFrame()
app.MainLoop()

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org