wx.grid problem

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

wx.grid problem

Nathan Smith
Hi guys,
First post to this group, so hopefully I'm doing this right.
I'm creating a program where I want to show the user a table which they can navigate and edit the cells text.
The code below doesn't actually error, but the table doesn't appear to form properly? Or at least, I can't navigate it using the arrow keys.
I use a screen reader, because I am visually impaired, so I'm not sure if this is just a limitation of wx python and screen readers? or what the deal is.
Hopefully someone can help
code:
  size=self.t1.GetValue()
  panel = wx.Panel(self, wx.ID_ANY, style= wx.WANTS_CHARS)
  self.panel.Destroy()
  self.panel=panel
  vbox = wx.BoxSizer(wx.VERTICAL) 
  hbox1 = wx.BoxSizer(wx.HORIZONTAL) 
  myGrid = gridlib.Grid(panel)
  myGrid.CreateGrid(int(size), int(size))
  self.grid=myGrid
  vbox.Add(myGrid)
  browse1 = wx.Button(panel, -1, "Create!")
  browse1.Bind(wx.EVT_BUTTON, self.maketable)

  browse2 = wx.Button(panel, -1, "Cancel.")
  browse1.Bind(wx.EVT_BUTTON, self.cancelbutton)
  hbox1.Add(browse1,1,wx.EXPAND|wx.ALIGN_LEFT|wx.ALL,5) 
  hbox1.Add(browse2,1,wx.EXPAND|wx.ALIGN_LEFT|wx.ALL,5) 
  vbox.Add(hbox1)
  panel.SetSizer(vbox)
  self.Layout()
  self.Center()
  self.Show();
  self.Fit()

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: wx.grid problem

Tim Roberts
Nathan Smith wrote:
>
> First post to this group, so hopefully I'm doing this right.
> I'm creating a program where I want to show the user a table which
> they can navigate and edit the cells text.
> The code below doesn't actually error, but the table doesn't appear to
> form properly? Or at least, I can't navigate it using the arrow keys.
> I use a screen reader, because I am visually impaired, so I'm not sure
> if this is just a limitation of wx python and screen readers? or what
> the deal is.

When you ask a question like this, please include a complete runnable
sample.  Your code is a little unusual here, and we can't tell where
this fits in a complete app.  Is this code included in a frame's
__init__ call?  Why are you destroying a previous panel?

In any case, I wrapped your code into a normal panel class / frame class
division, and it pretty much works as I would expect.  Attached.

--
Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.