[wxPython] wxPython-2_1_14-20000227, Frame Problem and statusbar problem
After trying out the new version of wxPython(2.2.14) I found that there
were a couple of problems with my code now.
1) At the bottom of the Frame there is now a bar across the bottom with a
grip? on the right hand side (45 deg lines) and something else on the left
hand side (vertical lines). This covers over some buttons on the bottom of
the panel inside.
2) I had a status bar in a wxPanel, but this no longer appears.
Here is the section of code (sorry it is kind of long):
Provides ploting for analog and digital results.
from wxPython.wx import *
# set curser as cross-hairs
# screen clicks with mouse
# Set up scroll bar
self.AdjustScrollbar(500) # pretrig delay + time
def AdjustScrollbar(self, winsize):
if rangex==0: #prevent divide by zero first time through during
print 'Size, pos, range, calc',winsize, posx, rangex,
self.SetScrollbars(20, 0, (winsize+20)/20, 0,
# wxSize used as default if Fit is used otherwise frame size above
#for displaying voltage, time and frequency
self.pointDisp= wxStatusBar(self, -1)
if __name__ == '__main__':
def __init__(self, parent=NULL):
wxFrame.__init__(self, parent, -1, "wx_plot_lines",
wxDefaultPosition,wxSize(600,520)) #size is used as default
unless Fit is used.
self.Destroy() # causes main loop to exit
traceback.print_exc() # and you still get your trace
GW> After trying out the new version of wxPython(2.2.14) I found that there
GW> were a couple of problems with my code now.
GW> 1) At the bottom of the Frame there is now a bar across the bottom with a
GW> grip? on the right hand side (45 deg lines) and something else on the left
GW> hand side (vertical lines). This covers over some buttons on the bottom of
GW> the panel inside.
This is your status bar. The vertical lines are the separators between the
fields, which are empty.
GW> 2) I had a status bar in a wxPanel, but this no longer appears.
You have to add the statusbar to the Frame, not to the Panel. And you have
to do it with
rather than box.Add(self.pointDisp,0, wxEXPAND)
Piet van Oostrum <[hidden email]>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: [hidden email]
Up until now, I have been using Programmers File Editor (free but
discontinued, and win only):
http://www.lancs.ac.uk/people/cpaap/pfe/ No python specific features, but IMHO helpful, simple and very reliable.
I too would be interested in knowing what other people recommend - features
that I have seen that I don't have that I would like:
* reliable source coloring
* folding of functions (they display on one line until you do something to
* integrated debugging environment
* runs on (in order of preference NT, Win98, HP-UX, Linux
> Up until now, I have been using Programmers File Editor (free but
> discontinued, and win only):
> http://www.lancs.ac.uk/people/cpaap/pfe/ > No python specific features, but IMHO helpful, simple and very reliable.
> I too would be interested in knowing what other people recommend -
> that I have seen that I don't have that I would like:
> * reliable source coloring
> * folding of functions (they display on one line until you do something
> display them)
> * integrated debugging environment
> * runs on (in order of preference NT, Win98, HP-UX, Linux
For a pure windooze editor, try TextPad 32:
- Syntax highlightning by plugins. Python mode is available and working
very well. Plugins for let's say 10-15 different languages/file types
are available. Key bindings are switchable between different editor
mimics a.s.o. ...
- Small and handy
For a cross platform editing OS ... errr ... editor, look for XEmacs:
- Available for many platforms, even Win32.
- Syntax hightlightning for Python and many (and I mean _many_) other
- Gods own keybindings (aka emacs :*), vi is also possible ...
- Draw back: it's HUGE! On my NT machine @ work it occupies around 60 MB
for a not at all full installation ... but hey, it's xemacs :)
I hope that's not too much offtopic spam ... get them and try them out.
Oh, and have fun :)
2science Scientific Consulting Dr. rer. nat Volker M. Göbbels
Martin-Luther-Kingstr. 70, 52146 Würselen
Tel. 0177-4736586 EMail: [hidden email]
Thanks for your note. I tried the code that Robin sent and it does display
the values in the status bar, but the status bar is not in the place that I
wanted it. I want it at the top of the panel. In version 2.1.11 it worked
ok and was shown properly, so something has changed between 2.1.11 and
I had a look at the docs and the parameters are:
The window parent, usually a frame.
The window identifier. It may take a value of -1 to indicate a default
The window position. A value of (-1, -1) indicates a default position,
chosen by either the windowing system or wxWindows, depending on platform.
The window size. A value of (-1, -1) indicates a default size, chosen by
either the windowing system or wxWindows, depending on platform.
The window style. See wxStatusBar.
so I assume that panel as a parent would be ok (although maybe not
typical). Also, a position is allowed so I assume that this can be placed
anywhere on its parent.
One other note is that the default style is without the grip which is only
available on windows. If no style is specified it should not appear
although it does.
If the status bar is derived from wxWindow why cant it be used like any
other wxWindow derived object?