1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

WxPython problem

  1. May 18, 2005 #1
    I've been trying for days to create a window that contains two grids, or a grid and another - any - window. I tried placing them on my own. I tried sizers. No use. It always goes gray.

    I asked for help on the usenet. No use. Now I come here.

    Code (Text):
    from wxPython.wx import *
    from wxPython.grid import *
    from time import *

    GameFrameID = wxNewId()
    GridID = wxNewId()
    ControlID = wxNewId()


    class GameFrame(wxFrame):
        def __init__(self, parent, title):
            wxFrame.__init__(self, parent, GameFrameID, title, size = (500, 500))

            board = wxGrid(parent = self, id = GridID)
            board.CreateGrid(numCols = 25, numRows = 25)
            board.DisableCellEditControl()
            board.DisableDragGridSize()
            board.SetColLabelSize(0)
            board.SetRowLabelSize(0)
            board.SetDefaultColSize(15, 1)
            board.SetDefaultRowSize(15, 1)

            boardbottom = board.GetDefaultRowSize() * board.GetNumberRows()
            boardright = board.GetDefaultColSize() * board.GetNumberCols()

            control = wxGrid(parent = self, id = ControlID)
            control.CreateGrid(numCols = 5, numRows = 1)
            control.DisableCellEditControl()
            control.DisableDragGridSize()
            control.SetColLabelSize(0)
            control.SetRowLabelSize(0)

            self.board = board
            self.boardbottom = boardbottom
            self.boardright = boardright
            self.control = control

            self.sizer = wxBoxSizer(wxVERTICAL)
            self.sizer.Add(self.board)
            self.sizer.Add(self.control)

            self.SetSizer(self.sizer)
            self.SetAutoLayout(true)
            self.sizer.Fit(self)
           
           
           
            self.Show()

    app = wxPySimpleApp()
    frame = GameFrame(None, "wxClick")
    app.MainLoop()
     
  2. jcsd
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Can you help with the solution or looking for help too?
Draft saved Draft deleted



Similar Discussions: WxPython problem
  1. Yahoo problems. (Replies: 2)

  2. Download problem (Replies: 4)

  3. Problems with Chrome (Replies: 19)

  4. Java problem. (Replies: 4)

  5. Keyboard Problems (Replies: 6)

Loading...