So with the deprication of python 2 creeping ever closer, I finally,
(later than nearly the whole world), decided to convert over to python
3, and Wx Python phoenix.
First, love the imagery, phoenix=reborn, wx python reborn.
But I do have one problem, that may be slightly difficult to explain,
but I'll do my best
First, here is an example of some code:
def __init__(self, parent, title):
super(Mywin, self).__init__(parent, title = title,size = (350,250))
# sets up some other screens too
panel = wx.Panel(self, wx.ID_ANY, style= wx.WANTS_CHARS)
panel.SetBackgroundColour("white") # aparrently black on white is
easier to read, and labels in wx are black anyway so...
vbox = wx.BoxSizer(wx.VERTICAL)
hbox1 = wx.BoxSizer(wx.HORIZONTAL)
l3 = wx.StaticText(panel, -1, "Screen Selection.")
hbox1.Add(l3, 1, wx.EXPAND|wx.ALIGN_LEFT|wx.ALL,5)
self.info1 = wx.ListCtrl(panel, -1, style = wx.LC_REPORT) # pairs
hbox1.Add(self.info1, 1, wx.EXPAND|wx.ALIGN_LEFT|wx.ALL,5)
self.info1.InsertColumn(0, "Screen Selection.")
for x in range(len(g.screens)): # draws from a variable of screen names
self.info1.Bind(wx.EVT_LIST_ITEM_SELECTED, self.changescreen) # so
that it can chang screens when necessary
l1 = wx.StaticText(panel, -1, "Folders and files.") # links with
hbox1.Add(l1, 1, wx.EXPAND|wx.ALIGN_LEFT|wx.ALL,5)
self.files = wx.ListCtrl(panel, -1, style = wx.LC_REPORT)
self.files.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.handle_move_file) #
not really relevant to my problem but included anyway
self.files.Bind(wx.EVT_LIST_ITEM_SELECTED, self.fileinfo) # see above
cl.changescreen(fake_event("Files.")) # fake event is a class that
just creates a fake object with a GetText method, probably lazy but
there you are
Now that the code is there, here's my problem:
In wx classic, I would create this, and when ever I tabbed into a list
CTRL it would read the name of that List CTRL to me, such as "files and
folders." Now, however, it just says List CTRL.
Further, when I alt tab into the window, it just says, "frame" when
previously it said nothing.
Why is this exactly?
I realise screen readers are a blindy thing, but perhaps wondered if one
of you guys would be able to spot where I'm missing a label, or not
linking the listctrl and labels together?
I always thought the way classic managed to link the two together was
pretty smart, but now also realise what I call "linking together" may
have just been a trick of some kind being done in the background.
I'd also be interested in any feedback you guys have regarding my code.
Being self taught, I realise there can be some pretty massive errors I
miss in terms of technique and redundancies.