2011-12-29 2 views

답변

1

사용 :

grid_widget.Scroll(row, column) 

편집 :로 제작 된

enter image description here

:

import wx 
import wx.grid as grid 
# 
class Button(wx.Frame): 
    def __init__(self, parent, source): 
     wx.Frame.__init__(self, parent, -1, size=(100,100)) 
     self.source = source 
     self.pos = 0 
     self.button = wx.Button(self, label='0') 
     self.Bind(wx.EVT_BUTTON, self.onbutton, self.button) 
     self.Show() 

    def onbutton(self, evt): 
     self.pos += 1 
     self.source.grid.Scroll(self.pos, self.pos) 
     self.button.SetLabel(str(self.pos)) 

class Frame(wx.Frame): 
    def __init__(self, parent): 
     wx.Frame.__init__(self, parent, -1, "Grid", size=(350,250)) 
     self.grid = grid.Grid(self) 
     self.grid.CreateGrid(20, 20) 
     self.but = Button(None, self) 


if __name__ == '__main__': 
    app = wx.PySimpleApp() 
    frame = Frame(None) 
    frame.Show() 
    app.MainLoop() 
+0

작동하지 않았다. 영향 없음 – user1000571

+0

@ user1000571 편집을 참조하십시오. – joaquin

0

내가 같은 있었다 여기에서 동작하는 예제가 probl 여자 이름. 그냥 격자 기능을 사용하려고 MakeCellVisible (행, 열)

관련 문제