User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 397,600 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,704 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser:

wxCanvas-Get current coordinates

Join Date: Mar 2006
Posts: 56
Reputation: Blujacker is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
Blujacker Blujacker is offline Offline
Junior Poster in Training

wxCanvas-Get current coordinates

  #1  
May 27th, 2007
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!
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 6:49 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC