pass wx.grid to wx.frame WX.python












0















All im trying to do is have 2 classes



1- creates a grid



2- takes the grid and puts it into a wx.notebook



so basically one class makes the grid the other class takes the grid as parameter and add it to the wx.notebook



but I keep getting an error that says



    self.m_grid1 = wx.grid.Grid(self) TypeError: Grid(): arguments did not match any overloaded call:


overload 1: too many arguments
overload 2: argument 1 has unexpected type 'reportGrid'



and here is the code for the Grid class is called
reportGrid



class reportGrid ():

def __init__( self, list):

self.m_grid1 = wx.grid.Grid(self)
self.m_grid1.Create(parent = None, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.WANTS_CHARS, name="Grid")
# Grid
self.m_grid1.CreateGrid( 7, 18 )
self.m_grid1.EnableEditing( True )
self.m_grid1.EnableGridLines( True )
self.m_grid1.SetGridLineColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOWTEXT ) )
self.m_grid1.EnableDragGridSize( True )
self.m_grid1.SetMargins( 0, 0 )

# Columns
self.m_grid1.EnableDragColMove( False )
self.m_grid1.EnableDragColSize( True )
self.m_grid1.SetColLabelSize( 30 )
self.m_grid1.SetColLabelAlignment( wx.ALIGN_CENTRE, wx.ALIGN_CENTRE )

# Rows
self.m_grid1.EnableDragRowSize( True )
self.m_grid1.SetRowLabelSize( 80 )
self.m_grid1.SetRowLabelAlignment( wx.ALIGN_CENTRE, wx.ALIGN_CENTRE )

# Label Appearance
self.m_grid1.SetColLabelValue(0, "Yield")
self.m_grid1.SetColLabelValue(1, "64CU")
self.m_grid1.SetColLabelValue(2, "Yield")
self.m_grid1.SetColLabelValue(3, "60CU")
self.m_grid1.SetColLabelValue(4, "Chain")
self.m_grid1.SetColLabelValue(5, "Logic")
self.m_grid1.SetColLabelValue(6, "Delay")
self.m_grid1.SetColLabelValue(7, "BIST")
self.m_grid1.SetColLabelValue(8, "CREST")
self.m_grid1.SetColLabelValue(9, "HSIO")
self.m_grid1.SetColLabelValue(10, "DC-Spec")
self.m_grid1.SetColLabelValue(11, "HBM")
self.m_grid1.SetColLabelValue(12, "OS")
self.m_grid1.SetColLabelValue(13, "PS")
self.m_grid1.SetColLabelValue(14, "Alarm")
self.m_grid1.SetColLabelValue(15, "JTAG")
self.m_grid1.SetColLabelValue(16, "Thermal IDD")
self.m_grid1.SetColLabelValue(17, "Insuff Config")

self.m_grid1.SetRowLabelValue(0, "Today")
self.m_grid1.SetRowLabelValue(1, "WTD")
self.m_grid1.SetRowLabelValue(2, "WW45")
self.m_grid1.SetRowLabelValue(3, "WW44")
self.m_grid1.SetRowLabelValue(4, "WW43")
self.m_grid1.SetRowLabelValue(5, "Monthly")
self.m_grid1.SetRowLabelValue(6, "QTD")
# Cell Defaults
for i in range(len(list)):
for j in range(len(list[i])):
self.m_grid1.SetCellValue(i,j, list[i][j])


self.m_grid1.SetDefaultCellAlignment( wx.ALIGN_LEFT, wx.ALIGN_TOP )


and here the class that takes it as a parameter and suppose to create notebook



class reportFrame ( wx.Frame ):

def __init__( self, parent , grid1):
wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Report", pos = wx.DefaultPosition, size = wx.Size( 7990,210 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )

self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )

bSizer6 = wx.BoxSizer( wx.VERTICAL )

self.m_notebook1 = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 )
self.m_notebook1.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_INFOBK ) )

self.m_panel2 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
bSizer14 = wx.BoxSizer( wx.HORIZONTAL )

bSizer14.Add( grid1, 0, wx.ALL, 5 )


self.m_panel2.SetSizer( bSizer14 )
self.m_panel2.Layout()
bSizer14.Fit( self.m_panel2 )
self.m_notebook1.AddPage( self.m_panel2, u"a page", False )
self.m_panel3 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
bSizer17 = wx.BoxSizer( wx.VERTICAL )

bSizer17.Add( grid1, 0, wx.ALL, 5 )
self.m_panel3.SetSizer( bSizer17 )
self.m_panel3.Layout()
bSizer17.Fit( self.m_panel3 )
self.m_notebook1.AddPage( self.m_panel3, u"a page", True )

bSizer6.Add( self.m_notebook1, 1, wx.EXPAND |wx.ALL, 3 )
self.SetSizer( bSizer6 )
self.Layout()

self.Centre( wx.BOTH )
self.Show(show=True)









share|improve this question



























    0















    All im trying to do is have 2 classes



    1- creates a grid



    2- takes the grid and puts it into a wx.notebook



    so basically one class makes the grid the other class takes the grid as parameter and add it to the wx.notebook



    but I keep getting an error that says



        self.m_grid1 = wx.grid.Grid(self) TypeError: Grid(): arguments did not match any overloaded call:


    overload 1: too many arguments
    overload 2: argument 1 has unexpected type 'reportGrid'



    and here is the code for the Grid class is called
    reportGrid



    class reportGrid ():

    def __init__( self, list):

    self.m_grid1 = wx.grid.Grid(self)
    self.m_grid1.Create(parent = None, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.WANTS_CHARS, name="Grid")
    # Grid
    self.m_grid1.CreateGrid( 7, 18 )
    self.m_grid1.EnableEditing( True )
    self.m_grid1.EnableGridLines( True )
    self.m_grid1.SetGridLineColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOWTEXT ) )
    self.m_grid1.EnableDragGridSize( True )
    self.m_grid1.SetMargins( 0, 0 )

    # Columns
    self.m_grid1.EnableDragColMove( False )
    self.m_grid1.EnableDragColSize( True )
    self.m_grid1.SetColLabelSize( 30 )
    self.m_grid1.SetColLabelAlignment( wx.ALIGN_CENTRE, wx.ALIGN_CENTRE )

    # Rows
    self.m_grid1.EnableDragRowSize( True )
    self.m_grid1.SetRowLabelSize( 80 )
    self.m_grid1.SetRowLabelAlignment( wx.ALIGN_CENTRE, wx.ALIGN_CENTRE )

    # Label Appearance
    self.m_grid1.SetColLabelValue(0, "Yield")
    self.m_grid1.SetColLabelValue(1, "64CU")
    self.m_grid1.SetColLabelValue(2, "Yield")
    self.m_grid1.SetColLabelValue(3, "60CU")
    self.m_grid1.SetColLabelValue(4, "Chain")
    self.m_grid1.SetColLabelValue(5, "Logic")
    self.m_grid1.SetColLabelValue(6, "Delay")
    self.m_grid1.SetColLabelValue(7, "BIST")
    self.m_grid1.SetColLabelValue(8, "CREST")
    self.m_grid1.SetColLabelValue(9, "HSIO")
    self.m_grid1.SetColLabelValue(10, "DC-Spec")
    self.m_grid1.SetColLabelValue(11, "HBM")
    self.m_grid1.SetColLabelValue(12, "OS")
    self.m_grid1.SetColLabelValue(13, "PS")
    self.m_grid1.SetColLabelValue(14, "Alarm")
    self.m_grid1.SetColLabelValue(15, "JTAG")
    self.m_grid1.SetColLabelValue(16, "Thermal IDD")
    self.m_grid1.SetColLabelValue(17, "Insuff Config")

    self.m_grid1.SetRowLabelValue(0, "Today")
    self.m_grid1.SetRowLabelValue(1, "WTD")
    self.m_grid1.SetRowLabelValue(2, "WW45")
    self.m_grid1.SetRowLabelValue(3, "WW44")
    self.m_grid1.SetRowLabelValue(4, "WW43")
    self.m_grid1.SetRowLabelValue(5, "Monthly")
    self.m_grid1.SetRowLabelValue(6, "QTD")
    # Cell Defaults
    for i in range(len(list)):
    for j in range(len(list[i])):
    self.m_grid1.SetCellValue(i,j, list[i][j])


    self.m_grid1.SetDefaultCellAlignment( wx.ALIGN_LEFT, wx.ALIGN_TOP )


    and here the class that takes it as a parameter and suppose to create notebook



    class reportFrame ( wx.Frame ):

    def __init__( self, parent , grid1):
    wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Report", pos = wx.DefaultPosition, size = wx.Size( 7990,210 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )

    self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )

    bSizer6 = wx.BoxSizer( wx.VERTICAL )

    self.m_notebook1 = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 )
    self.m_notebook1.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_INFOBK ) )

    self.m_panel2 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
    bSizer14 = wx.BoxSizer( wx.HORIZONTAL )

    bSizer14.Add( grid1, 0, wx.ALL, 5 )


    self.m_panel2.SetSizer( bSizer14 )
    self.m_panel2.Layout()
    bSizer14.Fit( self.m_panel2 )
    self.m_notebook1.AddPage( self.m_panel2, u"a page", False )
    self.m_panel3 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
    bSizer17 = wx.BoxSizer( wx.VERTICAL )

    bSizer17.Add( grid1, 0, wx.ALL, 5 )
    self.m_panel3.SetSizer( bSizer17 )
    self.m_panel3.Layout()
    bSizer17.Fit( self.m_panel3 )
    self.m_notebook1.AddPage( self.m_panel3, u"a page", True )

    bSizer6.Add( self.m_notebook1, 1, wx.EXPAND |wx.ALL, 3 )
    self.SetSizer( bSizer6 )
    self.Layout()

    self.Centre( wx.BOTH )
    self.Show(show=True)









    share|improve this question

























      0












      0








      0








      All im trying to do is have 2 classes



      1- creates a grid



      2- takes the grid and puts it into a wx.notebook



      so basically one class makes the grid the other class takes the grid as parameter and add it to the wx.notebook



      but I keep getting an error that says



          self.m_grid1 = wx.grid.Grid(self) TypeError: Grid(): arguments did not match any overloaded call:


      overload 1: too many arguments
      overload 2: argument 1 has unexpected type 'reportGrid'



      and here is the code for the Grid class is called
      reportGrid



      class reportGrid ():

      def __init__( self, list):

      self.m_grid1 = wx.grid.Grid(self)
      self.m_grid1.Create(parent = None, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.WANTS_CHARS, name="Grid")
      # Grid
      self.m_grid1.CreateGrid( 7, 18 )
      self.m_grid1.EnableEditing( True )
      self.m_grid1.EnableGridLines( True )
      self.m_grid1.SetGridLineColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOWTEXT ) )
      self.m_grid1.EnableDragGridSize( True )
      self.m_grid1.SetMargins( 0, 0 )

      # Columns
      self.m_grid1.EnableDragColMove( False )
      self.m_grid1.EnableDragColSize( True )
      self.m_grid1.SetColLabelSize( 30 )
      self.m_grid1.SetColLabelAlignment( wx.ALIGN_CENTRE, wx.ALIGN_CENTRE )

      # Rows
      self.m_grid1.EnableDragRowSize( True )
      self.m_grid1.SetRowLabelSize( 80 )
      self.m_grid1.SetRowLabelAlignment( wx.ALIGN_CENTRE, wx.ALIGN_CENTRE )

      # Label Appearance
      self.m_grid1.SetColLabelValue(0, "Yield")
      self.m_grid1.SetColLabelValue(1, "64CU")
      self.m_grid1.SetColLabelValue(2, "Yield")
      self.m_grid1.SetColLabelValue(3, "60CU")
      self.m_grid1.SetColLabelValue(4, "Chain")
      self.m_grid1.SetColLabelValue(5, "Logic")
      self.m_grid1.SetColLabelValue(6, "Delay")
      self.m_grid1.SetColLabelValue(7, "BIST")
      self.m_grid1.SetColLabelValue(8, "CREST")
      self.m_grid1.SetColLabelValue(9, "HSIO")
      self.m_grid1.SetColLabelValue(10, "DC-Spec")
      self.m_grid1.SetColLabelValue(11, "HBM")
      self.m_grid1.SetColLabelValue(12, "OS")
      self.m_grid1.SetColLabelValue(13, "PS")
      self.m_grid1.SetColLabelValue(14, "Alarm")
      self.m_grid1.SetColLabelValue(15, "JTAG")
      self.m_grid1.SetColLabelValue(16, "Thermal IDD")
      self.m_grid1.SetColLabelValue(17, "Insuff Config")

      self.m_grid1.SetRowLabelValue(0, "Today")
      self.m_grid1.SetRowLabelValue(1, "WTD")
      self.m_grid1.SetRowLabelValue(2, "WW45")
      self.m_grid1.SetRowLabelValue(3, "WW44")
      self.m_grid1.SetRowLabelValue(4, "WW43")
      self.m_grid1.SetRowLabelValue(5, "Monthly")
      self.m_grid1.SetRowLabelValue(6, "QTD")
      # Cell Defaults
      for i in range(len(list)):
      for j in range(len(list[i])):
      self.m_grid1.SetCellValue(i,j, list[i][j])


      self.m_grid1.SetDefaultCellAlignment( wx.ALIGN_LEFT, wx.ALIGN_TOP )


      and here the class that takes it as a parameter and suppose to create notebook



      class reportFrame ( wx.Frame ):

      def __init__( self, parent , grid1):
      wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Report", pos = wx.DefaultPosition, size = wx.Size( 7990,210 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )

      self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )

      bSizer6 = wx.BoxSizer( wx.VERTICAL )

      self.m_notebook1 = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 )
      self.m_notebook1.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_INFOBK ) )

      self.m_panel2 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
      bSizer14 = wx.BoxSizer( wx.HORIZONTAL )

      bSizer14.Add( grid1, 0, wx.ALL, 5 )


      self.m_panel2.SetSizer( bSizer14 )
      self.m_panel2.Layout()
      bSizer14.Fit( self.m_panel2 )
      self.m_notebook1.AddPage( self.m_panel2, u"a page", False )
      self.m_panel3 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
      bSizer17 = wx.BoxSizer( wx.VERTICAL )

      bSizer17.Add( grid1, 0, wx.ALL, 5 )
      self.m_panel3.SetSizer( bSizer17 )
      self.m_panel3.Layout()
      bSizer17.Fit( self.m_panel3 )
      self.m_notebook1.AddPage( self.m_panel3, u"a page", True )

      bSizer6.Add( self.m_notebook1, 1, wx.EXPAND |wx.ALL, 3 )
      self.SetSizer( bSizer6 )
      self.Layout()

      self.Centre( wx.BOTH )
      self.Show(show=True)









      share|improve this question














      All im trying to do is have 2 classes



      1- creates a grid



      2- takes the grid and puts it into a wx.notebook



      so basically one class makes the grid the other class takes the grid as parameter and add it to the wx.notebook



      but I keep getting an error that says



          self.m_grid1 = wx.grid.Grid(self) TypeError: Grid(): arguments did not match any overloaded call:


      overload 1: too many arguments
      overload 2: argument 1 has unexpected type 'reportGrid'



      and here is the code for the Grid class is called
      reportGrid



      class reportGrid ():

      def __init__( self, list):

      self.m_grid1 = wx.grid.Grid(self)
      self.m_grid1.Create(parent = None, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.WANTS_CHARS, name="Grid")
      # Grid
      self.m_grid1.CreateGrid( 7, 18 )
      self.m_grid1.EnableEditing( True )
      self.m_grid1.EnableGridLines( True )
      self.m_grid1.SetGridLineColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_WINDOWTEXT ) )
      self.m_grid1.EnableDragGridSize( True )
      self.m_grid1.SetMargins( 0, 0 )

      # Columns
      self.m_grid1.EnableDragColMove( False )
      self.m_grid1.EnableDragColSize( True )
      self.m_grid1.SetColLabelSize( 30 )
      self.m_grid1.SetColLabelAlignment( wx.ALIGN_CENTRE, wx.ALIGN_CENTRE )

      # Rows
      self.m_grid1.EnableDragRowSize( True )
      self.m_grid1.SetRowLabelSize( 80 )
      self.m_grid1.SetRowLabelAlignment( wx.ALIGN_CENTRE, wx.ALIGN_CENTRE )

      # Label Appearance
      self.m_grid1.SetColLabelValue(0, "Yield")
      self.m_grid1.SetColLabelValue(1, "64CU")
      self.m_grid1.SetColLabelValue(2, "Yield")
      self.m_grid1.SetColLabelValue(3, "60CU")
      self.m_grid1.SetColLabelValue(4, "Chain")
      self.m_grid1.SetColLabelValue(5, "Logic")
      self.m_grid1.SetColLabelValue(6, "Delay")
      self.m_grid1.SetColLabelValue(7, "BIST")
      self.m_grid1.SetColLabelValue(8, "CREST")
      self.m_grid1.SetColLabelValue(9, "HSIO")
      self.m_grid1.SetColLabelValue(10, "DC-Spec")
      self.m_grid1.SetColLabelValue(11, "HBM")
      self.m_grid1.SetColLabelValue(12, "OS")
      self.m_grid1.SetColLabelValue(13, "PS")
      self.m_grid1.SetColLabelValue(14, "Alarm")
      self.m_grid1.SetColLabelValue(15, "JTAG")
      self.m_grid1.SetColLabelValue(16, "Thermal IDD")
      self.m_grid1.SetColLabelValue(17, "Insuff Config")

      self.m_grid1.SetRowLabelValue(0, "Today")
      self.m_grid1.SetRowLabelValue(1, "WTD")
      self.m_grid1.SetRowLabelValue(2, "WW45")
      self.m_grid1.SetRowLabelValue(3, "WW44")
      self.m_grid1.SetRowLabelValue(4, "WW43")
      self.m_grid1.SetRowLabelValue(5, "Monthly")
      self.m_grid1.SetRowLabelValue(6, "QTD")
      # Cell Defaults
      for i in range(len(list)):
      for j in range(len(list[i])):
      self.m_grid1.SetCellValue(i,j, list[i][j])


      self.m_grid1.SetDefaultCellAlignment( wx.ALIGN_LEFT, wx.ALIGN_TOP )


      and here the class that takes it as a parameter and suppose to create notebook



      class reportFrame ( wx.Frame ):

      def __init__( self, parent , grid1):
      wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Report", pos = wx.DefaultPosition, size = wx.Size( 7990,210 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL )

      self.SetSizeHints( wx.DefaultSize, wx.DefaultSize )

      bSizer6 = wx.BoxSizer( wx.VERTICAL )

      self.m_notebook1 = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 )
      self.m_notebook1.SetBackgroundColour( wx.SystemSettings.GetColour( wx.SYS_COLOUR_INFOBK ) )

      self.m_panel2 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
      bSizer14 = wx.BoxSizer( wx.HORIZONTAL )

      bSizer14.Add( grid1, 0, wx.ALL, 5 )


      self.m_panel2.SetSizer( bSizer14 )
      self.m_panel2.Layout()
      bSizer14.Fit( self.m_panel2 )
      self.m_notebook1.AddPage( self.m_panel2, u"a page", False )
      self.m_panel3 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
      bSizer17 = wx.BoxSizer( wx.VERTICAL )

      bSizer17.Add( grid1, 0, wx.ALL, 5 )
      self.m_panel3.SetSizer( bSizer17 )
      self.m_panel3.Layout()
      bSizer17.Fit( self.m_panel3 )
      self.m_notebook1.AddPage( self.m_panel3, u"a page", True )

      bSizer6.Add( self.m_notebook1, 1, wx.EXPAND |wx.ALL, 3 )
      self.SetSizer( bSizer6 )
      self.Layout()

      self.Centre( wx.BOTH )
      self.Show(show=True)






      python python-3.x wxpython wxwidgets wxpython-phoenix






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 13 '18 at 18:10









      Jeff PerniaJeff Pernia

      368




      368
























          1 Answer
          1






          active

          oldest

          votes


















          1














          wx.grid.Grid(self) here self must be a wx.Window (or subclass) type. In your code it's reportGrid type.



          But reportGrid is not a wx.Window nor a subclass of wx.Window.



          If you have a page "pagegrid" (for example, of type wx.Panel or subclass) of the wx.Notebook then you can set



          class reportGrid (wx.Panel): 
          def __init__( self, list):
          self.m_grid1 = wx.grid.Grid(self)


          and inside your notebook definition



          pagegrid = reportGrid(nb)
          nb.AddPage(pagegrid , "Grid Page")





          share|improve this answer
























          • Thanks buddy I did something similar to this and it worked

            – Jeff Pernia
            Nov 13 '18 at 22:23











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53287108%2fpass-wx-grid-to-wx-frame-wx-python%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          wx.grid.Grid(self) here self must be a wx.Window (or subclass) type. In your code it's reportGrid type.



          But reportGrid is not a wx.Window nor a subclass of wx.Window.



          If you have a page "pagegrid" (for example, of type wx.Panel or subclass) of the wx.Notebook then you can set



          class reportGrid (wx.Panel): 
          def __init__( self, list):
          self.m_grid1 = wx.grid.Grid(self)


          and inside your notebook definition



          pagegrid = reportGrid(nb)
          nb.AddPage(pagegrid , "Grid Page")





          share|improve this answer
























          • Thanks buddy I did something similar to this and it worked

            – Jeff Pernia
            Nov 13 '18 at 22:23
















          1














          wx.grid.Grid(self) here self must be a wx.Window (or subclass) type. In your code it's reportGrid type.



          But reportGrid is not a wx.Window nor a subclass of wx.Window.



          If you have a page "pagegrid" (for example, of type wx.Panel or subclass) of the wx.Notebook then you can set



          class reportGrid (wx.Panel): 
          def __init__( self, list):
          self.m_grid1 = wx.grid.Grid(self)


          and inside your notebook definition



          pagegrid = reportGrid(nb)
          nb.AddPage(pagegrid , "Grid Page")





          share|improve this answer
























          • Thanks buddy I did something similar to this and it worked

            – Jeff Pernia
            Nov 13 '18 at 22:23














          1












          1








          1







          wx.grid.Grid(self) here self must be a wx.Window (or subclass) type. In your code it's reportGrid type.



          But reportGrid is not a wx.Window nor a subclass of wx.Window.



          If you have a page "pagegrid" (for example, of type wx.Panel or subclass) of the wx.Notebook then you can set



          class reportGrid (wx.Panel): 
          def __init__( self, list):
          self.m_grid1 = wx.grid.Grid(self)


          and inside your notebook definition



          pagegrid = reportGrid(nb)
          nb.AddPage(pagegrid , "Grid Page")





          share|improve this answer













          wx.grid.Grid(self) here self must be a wx.Window (or subclass) type. In your code it's reportGrid type.



          But reportGrid is not a wx.Window nor a subclass of wx.Window.



          If you have a page "pagegrid" (for example, of type wx.Panel or subclass) of the wx.Notebook then you can set



          class reportGrid (wx.Panel): 
          def __init__( self, list):
          self.m_grid1 = wx.grid.Grid(self)


          and inside your notebook definition



          pagegrid = reportGrid(nb)
          nb.AddPage(pagegrid , "Grid Page")






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 13 '18 at 19:56









          Ripi2Ripi2

          4,2831825




          4,2831825













          • Thanks buddy I did something similar to this and it worked

            – Jeff Pernia
            Nov 13 '18 at 22:23



















          • Thanks buddy I did something similar to this and it worked

            – Jeff Pernia
            Nov 13 '18 at 22:23

















          Thanks buddy I did something similar to this and it worked

          – Jeff Pernia
          Nov 13 '18 at 22:23





          Thanks buddy I did something similar to this and it worked

          – Jeff Pernia
          Nov 13 '18 at 22:23


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53287108%2fpass-wx-grid-to-wx-frame-wx-python%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Xamarin.iOS Cant Deploy on Iphone

          Glorious Revolution

          Dulmage-Mendelsohn matrix decomposition in Python