I've installed the RPMs for wxPython on Linux (RH9.0) before, but I've never tried to compile it from source until now, and am running into some problems. The wxWindows part of the install works fine, but when I cd down to the wxPython directory and try and build:
% python setup.py build_ext --inplace
I get the following error:
Found wx-config: /usr/local/bin/wxgtk-2.5-config
Preparing CORE...
Preparing GLCANVAS...
Preparing OGL...
Preparing STC...
Preparing XRC...
Preparing GIZMOS...
running build_ext
building '_ogl' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DSWIG_GLOBAL -DHAVE_CONFIG_H -DWXP_USE_THREAD=1 -UNDEBUG -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DwxUSE_DEPRECATED=0 -Iinclude -Isrc -I/usr/local//lib/wx/include/gtk-2.5 -I/usr/local//include -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include -Icontrib/ogl -I/usr/local/include/python2.3 -c contrib/ogl/gtk/ogl_wrap.cpp -o build/temp.linux-i686-2.3/contrib/ogl/gtk/ogl_wrap.o -O3
In file included from contrib/ogl/gtk/ogl_wrap.cpp:307:
contrib/ogl/oglhelpers.h:17:24: wx/ogl/ogl.h: No such file or directory
contrib/ogl/oglhelpers.h:18:27: wx/ogl/basicp.h: No such file or directory
contrib/ogl/oglhelpers.h:19:29: wx/ogl/constrnt.h: No such file or directory
contrib/ogl/oglhelpers.h:20:29: wx/ogl/bmpshape.h: No such file or directory
contrib/ogl/oglhelpers.h:21:26: wx/ogl/drawn.h: No such file or directory
So it looks like it can't find any of the headers in /usr/local/include/wx/ogl. Indeed, the directory isn't there. Did I do something wrong when I built the code? I thought I had followed the build instructions from the website to the letter. Any suggestions?
I'm looking for a way to unbind events. I've found that calling Bind() with None, works, but only catches the first occurrence of the event. Is there a way to unbind them all if there are more than one. I've enclosed some example code. It's a tiny app that puts two buttons on a panel. when you click the "bind" button, it binds a left click in the panel:
This works as expected, except that if you click the bind button ten times, you need to click the unbind button ten times to unbind all those events. I can probably work around this by being a whole lot more careful about multiply binding the same event, but I'd like a way to really unbind all of them.
running build_ext
building '_ogl' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -DSWIG_GLOBAL -DHAVE_CONFIG_H -DWXP_USE_THREAD=1 -UNDEBUG -DGTK_NO_CHECK_CASTS -D__WXGTK__ -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -DwxUSE_DEPRECATED=0 -Iinclude -Isrc -I/usr/local//lib/wx/include/gtk-2.5 -I/usr/local//include -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include -Icontrib/ogl -I/usr/local/include/python2.3 -c contrib/ogl/gtk/ogl_wrap.cpp -o build/temp.linux-i686-2.3/contrib/ogl/gtk/ogl_wrap.o -O3
In file included from contrib/ogl/gtk/ogl_wrap.cpp:307:
contrib/ogl/oglhelpers.h:17:24: wx/ogl/ogl.h: No such file or directory
contrib/ogl/oglhelpers.h:18:27: wx/ogl/basicp.h: No such file or directory
contrib/ogl/oglhelpers.h:19:29: wx/ogl/constrnt.h: No such file or directory
contrib/ogl/oglhelpers.h:20:29: wx/ogl/bmpshape.h: No such file or directory
contrib/ogl/oglhelpers.h:21:26: wx/ogl/drawn.h: No such file or directory
So it looks like it can't find any of the headers in /usr/local/include/wx/ogl. Indeed, the directory isn't there. Did I do something wrong when I built the code?
No, you just didn't do enough.
I thought I had followed the build instructions from the website to the letter. Any suggestions?
I'm looking for a way to unbind events. I've found that calling Bind() with None, works, but only catches the first occurrence of the event. Is there a way to unbind them all if there are more than one. I've enclosed some example code. It's a tiny app that puts two buttons on a panel. when you click the "bind" button, it binds a left click in the panel:
This works as expected, except that if you click the bind button ten times, you need to click the unbind button ten times to unbind all those events. I can probably work around this by being a whole lot more careful about multiply binding the same event, but I'd like a way to really unbind all of them.
Anyone have an idea?
You can do it now by using the Disconnect method directly, but you'll need to know the eventType ID to do that. For the next release I've added an Unbind method that works similarly to Bind but it calls Disconnect where it needs to down deep and then returns it's true/false return value. So your UnBindAll could be done as a loop:
while self.Unbind(wx.EVT_LEFT_DOWN):
pass
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Hi,
I do almost all of my event binding with the
eventManager (see wxPython Demo). It has very usefull
DeregisterListener and DeregisterWindow methods. It
makes the whole event handling process much more easy
and you don't need to remember or assign IDs.
Stani
Chris Barker wrote:
> Hi all,
>
> I'm looking for a way to unbind events. I've found
that calling Bind()
> with None, works, but only catches the first
occurrence of the event. Is
> there a way to unbind them all if there are more
than one. I've enclosed
> some example code. It's a tiny app that puts two
buttons on a panel.
> when you click the "bind" button, it binds a left
click in the panel:
>
> def BindAll(self, event = None):
> self.Bind(wx.EVT_LEFT_DOWN,
self.OnLeftDown )
>
> when you click the unbind, it calls:
>
> def UnBindAll(self, event = None):
> self.Bind(wx.EVT_LEFT_DOWN, None )
>
>
> This works as expected, except that if you click
the bind button ten
> times, you need to click the unbind button ten
times to unbind all those
> events. I can probably work around this by being a
whole lot more
> careful about multiply binding the same event, but
I'd like a way to
> really unbind all of them.
>
> Anyone have an idea?
You can do it now by using the Disconnect method
directly, but you'll
need to know the eventType ID to do that. For the
next release I've
added an Unbind method that works similarly to Bind
but it calls
Disconnect where it needs to down deep and then
returns it's true/false
return value. So your UnBindAll could be done as a
loop:
while self.Unbind(wx.EVT_LEFT_DOWN):
pass
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax
with wxPython!
Hi,
I do almost all of my event binding with the
eventManager (see wxPython Demo). It has very usefull
DeregisterListener and DeregisterWindow methods.
Thanks. I've been meaning to look into that...
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
def OnLeftDown(self,event):
print "Left button clicked in panel"
print "the event type is:", event.GetEventType()
it's also what gets printed by:
print wx.wxEVT_LEFT_DOWN
I've enclosed my little test app.
For the next release I've added an Unbind method that works similarly to Bind but it calls Disconnect where it needs to down deep and then returns it's true/false return value. So your UnBindAll could be done as a loop:
while self.Unbind(wx.EVT_LEFT_DOWN):
pass
That looks nice, maybe I'll just wait for that, and be more careful about multiple bindings in the meantime.
The first two args are the starting and ending window IDs. You use them
both if the event was conencted with a range of IDs, like with
EVT_MENU_RANGE. -1 is the wildcard value.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!