Showing another app window from within a wxpython app

2 views
Skip to first unread message

David Hutto

unread,
Sep 25, 2010, 1:18:12 PM9/25/10
to wxpytho...@googlegroups.com
Can a window generated by another module be triggered from within a
wxpython app window?
If not, can anyone make a suggestion as to how I might go about this
differently using
wx natives.

I was trying to launch the following function from a button within my wx app:

def showGraph(self, event):
print 'Graph.showGraph function accessed'
import matplotlib
from pylab import figure, show, rand
from matplotlib.patches import Ellipse

NUM = 1

#ells = [Ellipse(x =, y =, width = 2, height = 7, angle = 360)]
#ells2 = list(Ellipse(x = 20, y = 40, width = 2, height = 7, angle = 360))
ells2 = [Ellipse(xy=rand(2), width=rand(), height=rand(),
angle=rand()*360)for i in xrange(NUM)]
fig = figure()
ax = fig.add_subplot(111, aspect='equal')
for e in ells2:
ax.add_artist(e)
e.set_clip_box(ax.bbox)
e.set_alpha(4)
e.set_facecolor(rand(3))
x = 7
return x

ax.set_xlim(0, 10)
ax.set_ylim(0, 10)

show()

At first I received an error(can't remember what it was related to,
but I think it was in relation to matplotlib.use('Agg'))
that matplotlib.backend was already selected.

So is the cause that the show() function from pylab uses something
different to generate it's menu, and the two can't tango?

TIA,
David

David Hutto

unread,
Sep 25, 2010, 4:03:15 PM9/25/10
to wxpytho...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages