wx.ListCtrl / LC_SINGLE_SEL

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

wx.ListCtrl / LC_SINGLE_SEL

Karsten Hilbert
Hello all,

I have been wondering whether there is a way to set
wx.LC_SINGLE_SEL on a ListCtrl after the fact, that is,
somehow along those lines:

        lctrl = wx.ListCtrl(...)
        lctrl.some_property = wx.LC_SINGLE_SEL
        lctrl.some_method_or_other(style = wx.LC_SINGLE_SEL)

I have round

        .SetSingleStyle
        .SetWindowStyleFlag

and while the former sounds promising it doesn't do what I
desire (it rather calls SetWindowStyleFlag).

Can anyone shed some light.

Karsten
--
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B

--
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.ListCtrl / LC_SINGLE_SEL

Scott Talbert
On Mon, 13 Aug 2018, Karsten Hilbert wrote:

> I have been wondering whether there is a way to set
> wx.LC_SINGLE_SEL on a ListCtrl after the fact, that is,
> somehow along those lines:
>
> lctrl = wx.ListCtrl(...)
> lctrl.some_property = wx.LC_SINGLE_SEL
> lctrl.some_method_or_other(style = wx.LC_SINGLE_SEL)
>
> I have round
>
> .SetSingleStyle
> .SetWindowStyleFlag
>
> and while the former sounds promising it doesn't do what I
> desire (it rather calls SetWindowStyleFlag).
>
> Can anyone shed some light.

It seems like SetSingleStyle() should be doing what you want (add
LC_SINGLE_SEL while keeping existing styles).  Are you finding that it is
not?

Scott

--
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.ListCtrl / LC_SINGLE_SEL

Karsten Hilbert
On Mon, Aug 13, 2018 at 09:17:26AM -0400, Scott Talbert wrote:

> > I have been wondering whether there is a way to set
> > wx.LC_SINGLE_SEL on a ListCtrl after the fact, that is,
> > somehow along those lines:
> >
> > lctrl = wx.ListCtrl(...)
> > lctrl.some_property = wx.LC_SINGLE_SEL
> > lctrl.some_method_or_other(style = wx.LC_SINGLE_SEL)
> >
> > I have found
> >
> > .SetSingleStyle
> > .SetWindowStyleFlag
> >
> > and while the former sounds promising it doesn't do what I
> > desire (it rather calls SetWindowStyleFlag).
>
> It seems like SetSingleStyle() should be doing what you want (add
> LC_SINGLE_SEL while keeping existing styles).  Are you finding that it is
> not?

Didn't test as I misunderstood the documentation to suggest otherwise.

However, it does work :-)

Sorry for the noise ...

Karsten
--
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B

--
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.