Hi All,<br> 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.Scrollbar but 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. <br>
<br>import wx<br><br>class ComboBox(wx.Dialog):<br> def __init__(self, parent, id, title):<br> wx.Dialog.__init__(self, parent, id, title, size=(450, 470))<br><br> panel = wx.Panel(self, -1, (75, 20), (100, 127), style=wx.SUNKEN_BORDER)<br>
self.picture = wx.StaticBitmap(panel)<br> self.picture.SetBitmap(wx.Bitmap('srk.jpg'))<br> panel.SetBackgroundColour(wx.WHITE)<br> <br><br><br> wx.Button(self, 1, 'Close', (80, 220))<br>
wx.Button(self, 2, 'Zoomin', (80, 280))<br> self.Bind(wx.EVT_BUTTON, self.OnClose, id=1)<br> self.Bind(wx.EVT_BUTTON, self.OnZoom, id=2)<br><br><br> self.Centre()<br> self.ShowModal()<br>
self.Destroy()<br><br> def OnClose(self, event):<br> self.Close()<br><br> def OnZoom(self, event):<br>## sw = wx.ScrolledWindow(panel)<br>
## sw.SetScrollbars(20, 20, 155, 40)<br>
## sw.Scroll(50,10)<br> self.Close()<br><br>app = wx.App()<br>ComboBox(None, -1, 'picture box')<br>app.MainLoop()<br><br><br>But can please anybody suggest me how should i go ahead and solve this problem ??<br>
<br clear="all"><br>-- <br>Varsha Purohit,<br>Graduate Student