[Tutor] [tutor] Scrollbars around the image

Varsha Purohit varsha.purohit at gmail.com
Fri Feb 1 07:37:33 CET 2008

Hi All,
    I have made a simple panel where i am loading an image from the folder.
I have a button named zoomin. When i press this button a pair of horizontal
and vertical scrollbars should appear on the image panel nearby image. so
that we can see the zoomed image properly. I am trying to use
wx.Scrollbarbut i am not able to fix the scrollbars properly around
the image. I have
not added the scrollbar portion to the button handler in the code below.. i
have just commented out as its not actually working.

import wx

class ComboBox(wx.Dialog):
    def __init__(self, parent, id, title):
        wx.Dialog.__init__(self, parent, id, title, size=(450, 470))

        panel = wx.Panel(self, -1, (75, 20), (100, 127), style=
        self.picture = wx.StaticBitmap(panel)

        wx.Button(self, 1, 'Close', (80, 220))
        wx.Button(self, 2, 'Zoomin', (80, 280))
        self.Bind(wx.EVT_BUTTON, self.OnClose, id=1)
        self.Bind(wx.EVT_BUTTON, self.OnZoom, id=2)


    def OnClose(self, event):

    def OnZoom(self, event):
##        sw = wx.ScrolledWindow(panel)
##        sw.SetScrollbars(20, 20, 155, 40)
##        sw.Scroll(50,10)

app = wx.App()
ComboBox(None, -1, 'picture box')

But can please anybody suggest me how should i go ahead and solve this
problem ??

Varsha Purohit,
Graduate Student
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20080131/e8d5d84a/attachment-0001.htm 

More information about the Tutor mailing list