Hello everyone,i really need help with this big problem(to me its big).The project am writing requires a panel to display its current status information on.I figured that i will need to make that panel
scrollable because it will contain multiple lines of the text.My problem is i do not know how to use the scrolledpanel widget as this is the only widget i know of that can do this.please i really need help here or if there are other methods of implementing this,i 'd love to know..Thanks in advance

Recommended Answers

All 2 Replies

Here is an example of how one works:

import  wx
import  wx.lib.scrolledpanel as scrolled

class TestPanel(scrolled.ScrolledPanel):
    def __init__(self, parent):
        scrolled.ScrolledPanel.__init__(self, parent, -1)

        vbox = wx.BoxSizer(wx.VERTICAL)
        desc = wx.StaticText(self, -1,
                            "ScrolledPanel extends wx.ScrolledWindow, adding all "
                            "the necessary bits to set up scroll handling for you.\n\n"
                            "Here are three fixed size examples of its use. The "
                            "demo panel for this sample is also using it -- the \nwxStaticLine "
                            "below is intentionally made too long so a scrollbar will be "
                            "activated."
                            )
        desc.SetForegroundColour("Blue")
        vbox.Add(desc, 0, wx.ALIGN_LEFT|wx.ALL, 5)

      

        self.SetSizer(vbox)
        self.SetAutoLayout(1)
        self.SetupScrolling()


app = wx.App(0)
frame = wx.Frame(None, wx.ID_ANY)
fa = TestPanel(frame)
frame.Show()
app.MainLoop()

Hope that helps you out!:)

Thanks alot.It was really helpful.God Bless

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.