drawing a very long line on the screen and how much of the lifting I have to do

Nathan smith <[email protected]> Fri, 28 May 2021 18:56:21 +0100
Newsgroups gmane.comp.python.wxpython
Message-ID <[email protected]>
Hi folks,


Me again asking what is likely a very obvious question but for a blindy 
developer not so much.

I'm wondering how WX python handles things that are bigger than the screen.

So what i mean by this is I have a ten by ten grid, each square is 2 CM 
in size.

I'm currently drawing this using wx.PaintDC and a lot of (probably 
overdone) maths to work out coordinates of squares to coordinates on the 
screen.

A ten by ten works fine as you can imagine, most screens are able to 
handle 20 CM by 20 CM.

But what if I was to implement a 20 20 grid?

This would scroll off the screen so my question to the WX group is do I 
need to handle the scrolling?

The wx.PaintDC is currently drawing on the frame (I should likely change 
that to the panel) so could a mouse user just scroll and have the rest 
of the grid shown?

I admit myself, 2 CM is probably too big for squares but eventually I'd 
hit this snag.

Related to this therefore, if the panel or frame is automatically 
handling the scroll, how would I go about interacting with this from a 
keyboard perspective?

IE is there a function I could call like this?


def OnKeyPress(self, event):

  if(event.keyCode=="space"): # just using seudo code for the moment

    self.scroll_down_a_page())


thanks in advance!

Nathan

-- 
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/aa757801-405f-b419-3dd8-f7ab9ab2f424%40gmail.com.