In my continuing one-man struggle with the wxListBox widget,
I have now generated two scripts, one of which works as
expected, the other which doesn't. The only difference
between the two is that the working one places the ListBox
on a frame, the broken one places it on a dialog.
Can someone please tell me why the second script doesn't
work?!?
Thanks,
Denny
PS - this behaviour is consistent across various versions
of both python and wxPython. I'm running on top of Linux,
Red Hat 6.1 and 6.2 to be precise.
···
----------------------------------------------------------
Denny De La Haye \ www-edc.eng.cam.ac.uk/~djd33
Engineering Design Centre, \ www-edc.eng.cam.ac.uk
Department of Engineering, \ www.eng.cam.ac.uk
University of Cambridge, UK \ www.cam.ac.uk
----------------------------------------------------------
"The more you read, the less everyone else knows"
In my continuing one-man struggle with the wxListBox widget,
I have now generated two scripts, one of which works as
expected, the other which doesn't. The only difference
between the two is that the working one places the ListBox
on a frame, the broken one places it on a dialog.
The wxDialog doesn't get an initial EVT_SIZE event like the wxFrame does, so
there is no opportunity for the autolayout algorithm to run b. This patch
fixes your sample:
*** list_dialog.py.orig Thu Mar 01 11:21:55 2001
--- list_dialog.py Thu Mar 01 11:21:46 2001
The wxDialog doesn't get an initial EVT_SIZE event like the wxFrame does,
so
there is no opportunity for the autolayout algorithm to run b. This patch
^^^
Was supposed to say "before it is shown." Don't know what happened to the
rest of the text, must have gotten lost somewhere between my brain and the
keyboard, which seems to be a common occurrence these days... Better get a
new keyboard I guess. <wink>
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!
Erm, nope. I get the exact same behaviour with that line inserted...
Regards,
Denny
···
On Thu, 1 Mar 2001, Robin Dunn wrote:
The wxDialog doesn't get an initial EVT_SIZE event like the wxFrame does, so
there is no opportunity for the autolayout algorithm to run b. This patch
fixes your sample:
[ ... ]
+ self.Layout()
----------------------------------------------------------
Denny De La Haye \ www-edc.eng.cam.ac.uk/~djd33
Engineering Design Centre, \ www-edc.eng.cam.ac.uk
Department of Engineering, \ www.eng.cam.ac.uk
University of Cambridge, UK \ www.cam.ac.uk
----------------------------------------------------------
"The more you read, the less everyone else knows"
I did wonder, but figured it would be rude to complain when you were
proposing a solution to my woes
Shame it didn't work. I've uploaded the patched version to the website
now, running it does exactly the same as before on my setup - the first
item is selected (for no apparent reason) and the 3rd and 5th aren't
Regards,
Denny
PS - keyboards... I'm sure all my life's problems would be
instantly solved if I could just find a black, ergonomic,
cordless, NOT soft-touch keyboard for my PC
···
On Thu, 1 Mar 2001, Robin Dunn wrote:
Was supposed to say "before it is shown." Don't know what happened to the
rest of the text, must have gotten lost somewhere between my brain and the
keyboard, which seems to be a common occurrence these days... Better get
a new keyboard I guess. <wink>
----------------------------------------------------------
Denny De La Haye \ www-edc.eng.cam.ac.uk/~djd33
Engineering Design Centre, \ www-edc.eng.cam.ac.uk
Department of Engineering, \ www.eng.cam.ac.uk
University of Cambridge, UK \ www.cam.ac.uk
----------------------------------------------------------
"The more you read, the less everyone else knows"
Nope, that didn't work either... nor did putting both in, in either
order... any other ideas?
Regards,
Denny
···
On Thu, 1 Mar 2001, Robin Dunn wrote:
> > + self.Layout()
>
> Erm, nope. I get the exact same behaviour with that line inserted...
It worked on MSW... Try putting a SetSize there instead.
----------------------------------------------------------
Denny De La Haye \ www-edc.eng.cam.ac.uk/~djd33
Engineering Design Centre, \ www-edc.eng.cam.ac.uk
Department of Engineering, \ www.eng.cam.ac.uk
University of Cambridge, UK \ www.cam.ac.uk
----------------------------------------------------------
"The more you read, the less everyone else knows"
> > > + self.Layout()
> >
> > Erm, nope. I get the exact same behaviour with that line inserted...
>
> It worked on MSW... Try putting a SetSize there instead.
+ self.SetSize([400,200])
Nope, that didn't work either... nor did putting both in, in either
order... any other ideas?
Try setting a size different than what it is already, or use wxDefaultSize
in the wxDialog.__init__.
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!
Why does it select the first item in the list, is some sort of spurious
focus / selection data being sent to it? I notice that in the working
frame-based version, it doesn't select any items unless you tell it to.
Regards,
Denny
···
On Thu, 1 Mar 2001, Robin Dunn wrote:
> > It worked on MSW... Try putting a SetSize there instead.
>
> + self.SetSize([400,200])
>
> Nope, that didn't work either...
Try setting a size different than what it is already, or use
wxDefaultSize in the wxDialog.__init__.
----------------------------------------------------------
Denny De La Haye \ www-edc.eng.cam.ac.uk/~djd33
Engineering Design Centre, \ www-edc.eng.cam.ac.uk
Department of Engineering, \ www.eng.cam.ac.uk
University of Cambridge, UK \ www.cam.ac.uk
----------------------------------------------------------
"The more you read, the less everyone else knows"
Why does it select the first item in the list, is some sort of spurious
focus / selection data being sent to it? I notice that in the working
frame-based version, it doesn't select any items unless you tell it to.
Um, I guess you should have defined what "broken" and "works as expected"
means. I thought we were talking about the dialog version not doing proper
layout of the components in the sizer, which is what appeared "broken" when
I ran it.
With the addition of self.Layout() they both look and act the same for me,
with the 3rd and 5th items selected. I guess I need to fire up my Linux VM
so I can see what you are seeing...
BRB,
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!
>
> Why does it select the first item in the list, is some sort of spurious
> focus / selection data being sent to it? I notice that in the working
> frame-based version, it doesn't select any items unless you tell it to.
>
According to "print self.param_list.GetSelections()" the correct items are
selected, but for some reason it is not displayed that way. Please enter
this bug in the bug tracker so one of the wxGTK guys will take a look at it.
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!
Um, I guess you should have defined what "broken" and "works as expected"
means. I thought we were talking about the dialog version not doing proper
layout of the components in the sizer, which is what appeared "broken" when
I ran it.
Oh great... So in Linux the item selection code is broken, but that
works fine in Windows. On the other hand, in Windows the layout code
is broken, but that works fine in Linux...
I guess that's multi-platform development for you
I guess I need to fire up my Linux VM so I can see what you are seeing...
BRB,
That sounds promising...
Denny
···
On Thu, 1 Mar 2001, Robin Dunn wrote:
----------------------------------------------------------
Denny De La Haye \ www-edc.eng.cam.ac.uk/~djd33
Engineering Design Centre, \ www-edc.eng.cam.ac.uk
Department of Engineering, \ www.eng.cam.ac.uk
University of Cambridge, UK \ www.cam.ac.uk
----------------------------------------------------------
"The more you read, the less everyone else knows"
Ah, it's that bad is it? Okay, thanks for looking into it...
Erm, 'length of piece of string' question here I know, but how long does
it generally take these people to look into problems with their stuff?
Regards,
Denny
···
On Thu, 1 Mar 2001, Robin Dunn wrote:
According to "print self.param_list.GetSelections()" the correct items are
selected, but for some reason it is not displayed that way. Please enter
this bug in the bug tracker so one of the wxGTK guys will take a look at it.
----------------------------------------------------------
Denny De La Haye \ www-edc.eng.cam.ac.uk/~djd33
Engineering Design Centre, \ www-edc.eng.cam.ac.uk
Department of Engineering, \ www.eng.cam.ac.uk
University of Cambridge, UK \ www.cam.ac.uk
----------------------------------------------------------
"The more you read, the less everyone else knows"