Hi, this is my code:
# -*- coding: cp1250 -*-
import wx
class Okno:
def __init__(self,parent=None,id=wx.ID_ANY,title="Graf"):
self.okno=wx.MDIChildFrame(parent,title="Graf",id=-1)
self.okno.Maximize()
self.okno.SetAutoLayout(True)
self.okno.SetBackgroundColour("#FCFCFE")
self.sizer = wx.FlexGridSizer(2,2,0,0)
self.canvas = wx.ScrolledWindow(self.okno, id=wx.ID_ANY)
self.canvas.EnableScrolling(True, True)
self.canvas.SetScrollbars(20, 20, 1000/20, 1000/20)
self.sizer.Add(self.canvas, 1, wx.EXPAND)
self.sizer.AddGrowableRow(0, 1)
self.sizer.AddGrowableCol(0, 1)
self.okno.SetSizer(self.sizer)
self.canvas.Bind(wx.EVT_PAINT, self.OnPaint)
def OnPaint(self, event):
pass
if __name__ == "__main__":
okno = wx.App(0)
parent=wx.MDIParentFrame(None,size=wx.Size(500,500))
o=Okno(parent)
parent.Show()
okno.MainLoop()
As you can see, its scrolled canvas and i need to get current coordinates of part of canvas which i can see (sory my english). For exapmle: If i run my code, that left up corner is (0,0) and down right corner is (500,500).
Thanks!