Problems with wx.CheckListBox on OSX

As far as I can tell, if a checkbox is ever checked by the user, is it
forever reported as being checked, whether the user unchecks it or
not. Sample script below; try checking some boxes, and then
unchecking some. Anything that you check and later uncheck is
(programatically) reported to be checked regardless of the current
state of the checkbox.

Doesn't seem to be a problem on windows; have not checked Linux yet.
My build of wxwidgets/wxpython on OSX is 2.9.1.1 (osx-carbon-unicode).

Sample script below:

import wx

class TestPanel(wx.Panel):
    def __init__(self, parent):
        wx.Panel.__init__(self, parent, -1)

        sampleList = ['one', 'two', 'three', 'four']

        self.lb = wx.CheckListBox(self, -1, wx.DefaultPosition,
(200,200), sampleList)

        self.Bind(wx.EVT_CHECKLISTBOX, self.EvtCheckListBox, self.lb)

    def EvtCheckListBox(self, evt):
        print "The current selections are: "+str(self.lb.GetChecked())
        evt.Skip()

# start the app
app = wx.App()
frame = wx.Frame(None)
panel = TestPanel(frame)
frame.Show(True)
print wx.version()
app.MainLoop()

As a follow-up; neither Windows or Linux (same version of wxPython/wxWidgets) exhibit this behavior.

···

On Sun, Nov 20, 2011 at 3:13 PM, dhyams dhyams@gmail.com wrote:

As far as I can tell, if a checkbox is ever checked by the user, is it

forever reported as being checked, whether the user unchecks it or

not. Sample script below; try checking some boxes, and then

unchecking some. Anything that you check and later uncheck is

(programatically) reported to be checked regardless of the current

state of the checkbox.

Doesn’t seem to be a problem on windows; have not checked Linux yet.

My build of wxwidgets/wxpython on OSX is 2.9.1.1 (osx-carbon-unicode).

Sample script below:

import wx

class TestPanel(wx.Panel):

def __init__(self, parent):

    wx.Panel.__init__(self, parent, -1)



    sampleList = ['one', 'two', 'three', 'four']



    [self.lb](http://self.lb) = wx.CheckListBox(self, -1, wx.DefaultPosition,

(200,200), sampleList)

    self.Bind(wx.EVT_CHECKLISTBOX, self.EvtCheckListBox, [self.lb](http://self.lb))



def EvtCheckListBox(self, evt):

    print "The current selections are: "+str(self.lb.GetChecked())

    evt.Skip()

start the app

app = wx.App()

frame = wx.Frame(None)

panel = TestPanel(frame)

frame.Show(True)

print wx.version()

app.MainLoop()


Daniel Hyams
dhyams@gmail.com

I don't have a Carbon build installed currently, but it's working fine for me with a 2.9.2.4 Cocoa build. If it's still not behaving correctly for you with a 2.9.2.4 Carbon build then please create a ticket for it at trac.wxwidgets.org.

···

On 11/20/11 12:13 PM, dhyams wrote:

As far as I can tell, if a checkbox is ever checked by the user, is it
forever reported as being checked, whether the user unchecks it or
not. Sample script below; try checking some boxes, and then
unchecking some. Anything that you check and later uncheck is
(programatically) reported to be checked regardless of the current
state of the checkbox.

Doesn't seem to be a problem on windows; have not checked Linux yet.
My build of wxwidgets/wxpython on OSX is 2.9.1.1 (osx-carbon-unicode).

--
Robin Dunn
Software Craftsman

Still not working for 2.9.2.4 osx-carbon (classic); it does work in
the cocoa build. Created ticket at wxTrac has been migrated to GitHub Issues - wxWidgets

···

On Nov 23, 1:22 pm, Robin Dunn <ro...@alldunn.com> wrote:

On 11/20/11 12:13 PM,dhyamswrote:

> As far as I can tell, if a checkbox is ever checked by the user, is it
> forever reported as being checked, whether the user unchecks it or
> not. Sample script below; try checking some boxes, and then
> unchecking some. Anything that you check and later uncheck is
> (programatically) reported to be checked regardless of the current
> state of the checkbox.

> Doesn't seem to be a problem on windows; have not checked Linux yet.
> My build of wxwidgets/wxpython on OSX is 2.9.1.1 (osx-carbon-unicode).

I don't have a Carbon build installed currently, but it's working fine
for me with a 2.9.2.4 Cocoa build. If it's still not behaving correctly
for you with a 2.9.2.4 Carbon build then please create a ticket for it
at trac.wxwidgets.org.

--
Robin Dunn
Software Craftsmanhttp://wxPython.org