Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

ComboCrtl demo does not behave well on Linux - scrolling dismisses popup listbox

67 views
Skip to first unread message

Jacob Barhak

unread,
Aug 11, 2014, 4:53:03 AM8/11/14
to wxpytho...@googlegroups.com
Hello to demo.py creators, or anyone with experience in writing controls for Linux,

Whoever wrote demo.py has done a great service. It was used as good examples to create the system I am working on.

However, it seems the examples there need some polishing and perhaps upgraded in time.

I have a combo box control that is based on ComboCtrl demo in demo.py and I noticed strange behavior on Linux Ubuntu 14.04 with anaconda. The issue is that I cannot vertically scroll the list box. For some reason the click is interpreted as a lose focus event and the popup listbox closes rather than scrolling down to allow selecting a value down the list.

I went back to the basics and tried the combo box controls in demo.py and found out that the behavior is the same. Whenever a scroll bar is moved, the system closes the list box.

Is there anyway to prevent this and allow the scroll to happen? Any bind or unbind command needed during setup?

I am using WxPython 3.0 on a virtual box Ubuntu 14.04 using Anaconda 2.01 installed with the command:
conda install wxpython -c asmeurer


I hope someone can fix the demo so I can fix my code accordingly.

                      Jacob

Nathan McCorkle

unread,
Aug 11, 2014, 12:06:31 PM8/11/14
to wxpytho...@googlegroups.com
Does it also happen with Choice[whatever the suffix is, maybe List]?

Work

unread,
Aug 11, 2014, 4:21:54 PM8/11/14
to wxpytho...@googlegroups.com, wxpytho...@googlegroups.com
Hi Nathan,

The ChoiceBook demo works fine. When extending the choice list - the scrolling mechanism is different - instead of scroll bars you get an up / down arrows at the list edges. You get similar behavior in ComboBox demo under core windows/controls section. The latter example binds the focus events and skips them.

It seems these examples are more stable. I will try to see if capturing the focus events fixes my code.

However, it seems appropriate to fix the demo if it does not work well on some system.

I appreciate the idea.

Jacob

Sent from my iPhone

On Aug 11, 2014, at 11:06 AM, Nathan McCorkle <nmz...@gmail.com> wrote:

> Does it also happen with Choice[whatever the suffix is, maybe List]?
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "wxPython-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/wxpython-users/aj-psdRmDcE/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to wxpython-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Nathan McCorkle

unread,
Aug 12, 2014, 2:08:46 PM8/12/14
to wxpytho...@googlegroups.com
I guess I meant this one with no suffix!

Does that have the same strange behaviour?

Work

unread,
Aug 12, 2014, 4:02:42 PM8/12/14
to wxpytho...@googlegroups.com, wxpytho...@googlegroups.com
Hi Nathan,

The ChoiceBook demo you will find in my last post uses the choice control. 

However, I need multiple columns in my list box and changing the code base significantly to use a different control does not make sense unless there is no  easy fix to the demo I mentioned. 

Since the code I work on relies on the combo ctrl demo, fixing the demo will most probably provide the fix I need. And others will then be able to reliably build on this demo. 

     Jacob

Sent from my iPhone

Work

unread,
Aug 18, 2014, 6:17:51 AM8/18/14
to wxpytho...@googlegroups.com, wxpytho...@googlegroups.com
Hi Nathan, or anyone else interested,

You are the only one suggesting solutions here, so I guess I ask you. 

I tried to run the inspection app to figure out what is the offending event. It seems that the event that may cause the problem is: 
EVT_CHILD_FOCUS

This event happens twice just after clicking on the list popup scroll bar, once for the ComboBox and once for the text control. This is followed by the following event:
EVT_COMBOBOX_CLOSEUP

After which there are a few other events related to other controls that gain focus. 

I tried changing the Bind for some events, yet without success. 

If Nathan or anyone else has any idea for a fix I can try or even for another diagnostic, please let me know. I hope someone has an idea. 

           Jacob


Sent from my iPhone

Nathan McCorkle

unread,
Aug 18, 2014, 12:27:06 PM8/18/14
to wxpytho...@googlegroups.com
Hmm, what widget are you using exactly now (ComboCtrl, Choice, etc...)? If it has the EVT_CHILD_FOCUS handler functions in Python (rather than passing the calls into some C/C++ wxWidget module) you might try using event.Veto() to prevent the event from propagating to further handlers (the event that is passed into the handler function). Veto doesn't work with all Events though.

Anna Petrášová

unread,
Aug 18, 2014, 10:25:41 PM8/18/14
to wxpytho...@googlegroups.com
Hi all,


On Mon, Aug 11, 2014 at 4:53 AM, Jacob Barhak <jacob....@gmail.com> wrote:
Hello to demo.py creators, or anyone with experience in writing controls for Linux,

Whoever wrote demo.py has done a great service. It was used as good examples to create the system I am working on.

However, it seems the examples there need some polishing and perhaps upgraded in time.

I have a combo box control that is based on ComboCtrl demo in demo.py and I noticed strange behavior on Linux Ubuntu 14.04 with anaconda. The issue is that I cannot vertically scroll the list box. For some reason the click is interpreted as a lose focus event and the popup listbox closes rather than scrolling down to allow selecting a value down the list.

I believe you are experiencing the problem with 'overlay scrollbars' in Ubuntu [1]. I don't know what could be done about it except for disabling this feature, for example test with

export LIBOVERLAY_SCROLLBAR=0
python demo/ComboCtrl.py



Anna


I went back to the basics and tried the combo box controls in demo.py and found out that the behavior is the same. Whenever a scroll bar is moved, the system closes the list box.

Is there anyway to prevent this and allow the scroll to happen? Any bind or unbind command needed during setup?

I am using WxPython 3.0 on a virtual box Ubuntu 14.04 using Anaconda 2.01 installed with the command:
conda install wxpython -c asmeurer


I hope someone can fix the demo so I can fix my code accordingly.

                      Jacob

--
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 wxpython-user...@googlegroups.com.

Work

unread,
Aug 19, 2014, 12:39:59 PM8/19/14
to wxpytho...@googlegroups.com, wxpytho...@googlegroups.com
Thanks Anna,

This seems to be the issue. Good catch. 

When I execute the command:
export LIBOVERLAY_SCROLLBAR=0

And then run my application I get old style scroll bars that work in the combo box as before. 

Now my question becomes, how do I ask for this old type of scroll bar from within my python application?
Using os.system with the export command will not set things properly for the already running process. Is there a proper wx mechanism for asking for the old type scrollbars?

I hope there is a simple fix. 

         Jacob


Sent from my iPhone
You received this message because you are subscribed to a topic in the Google Groups "wxPython-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wxpython-users/aj-psdRmDcE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wxpython-user...@googlegroups.com.

Nathan McCorkle

unread,
Aug 19, 2014, 3:14:31 PM8/19/14
to wxpytho...@googlegroups.com
Maybe you could try (likely before the wx.App is started, or before wx is imported, though maybe I'm wrong):

os.environ['LIBOVERLAY_SCROLLBAR'] = 0

Work

unread,
Aug 19, 2014, 6:01:28 PM8/19/14
to wxpytho...@googlegroups.com, wxpytho...@googlegroups.com
Thanks Nathan,

This seems to work fine. Only the command would be:
os.environ['LIBOVERLAY_SCROLLBAR')='0'

I use this command before importing wx. I have to run more tests, yet it seems the problem is gone.

The issue with overlay scrollbars should be solved independently, yet I am happy with this fix. 

Again, also thanks to Anna who isolated the issue. 

         Jacob

Sent from my iPhone

On Aug 19, 2014, at 2:14 PM, Nathan McCorkle <nmz...@gmail.com> wrote:

Maybe you could try (likely before the wx.App is started, or before wx is imported, though maybe I'm wrong):

os.environ['LIBOVERLAY_SCROLLBAR'] = 0

--

Jacob Barhak

unread,
Aug 20, 2014, 4:12:38 AM8/20/14
to wxpytho...@googlegroups.com
Sorry All,

The correct line for fixing this is:
os.environ['LIBOVERLAY_SCROLLBAR']='0'

The previous two lines were wrong - this is what happens when you type rather than copy. This one was copied directly from a working tested version.

This fix should remove any confusion.

         Jacob
To unsubscribe from this group and all its topics, send an email to wxpython-users+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages