Найти - Пользователи
Полная версия: Проблема багов в питоне и их по этапные решения
Начало » Python для экспертов » Проблема багов в питоне и их по этапные решения
1
Max_Odessa
В частности есть вопрос: Я работаю на стационарной машине под Ubuntu 10.10, Eclipse, Python 2.6.6,Wx 2.8.12.0,PyOpengl 3.0.1,
на ноуте Ubuntu 10.04,Eclipse, Python 2.6.6,Wx 2.8.10.1,PyOpengl 3.0.1
на стационаре при обработке файла sixteen.py имеется следующий лог :

The program ‘python2.6’ received an X Window System error.
This probably reflects a bug in the program.
The error was ‘BadDrawable (invalid Pixmap or Window parameter)’.
(Details: serial 610 error_code 9 request_code 137 minor_code 8)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the –sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)

На ноуте всё ок.
Хотя файл Work_with_glpanel.py работает без проблем и на ноуте и на стационаре.

Вот код для sixteen.py:
from wx import *
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
from wx import glcanvas
import time
import struct
import sys
from operator import *
from Image import *
# ascii codes for various special keys
ESCAPE = '\033'
PAGE_UP = 73
PAGE_DOWN = 81
UP_ARROW = 72
DOWN_ARROW = 80
LEFT_ARROW = 75
RIGHT_ARROW = 77

#index = glGenLists(1)

# The number of our GLUT window
window = None

# lighting on/off (1 = on, 0 = off)
light = 0


xrot = 0 # x rotation
yrot = 0 # y rotation
xspeed = 0 # x rotation speed
yspeed = 0 # y rotation speed

z = 0 # depth into the screen.

# white ambient light at half intensity (rgba)
#LightAmbient = [ 0.5, 0.5, 0.5, 1.0 ]

# super bright, full intensity diffuse light.
#LightDiffuse = [ 1.0, 1.0, 1.0, 1.0 ]

# position of light (x, y, z, (position of light))
#LightPosition = [ 0.0, 0.0, 2.0, 1.0 ]
#glRotatef(xrot,1.0,0.0,0.0) # Rotate The Cube On It's X Axis

filter = 0 # Which Filter To Use (nearessequencet/linear/mipmapped)
texture = range(3) # Storage for 3 textures.
blend = 0 # Turn blending on/off

# A general OpenGL initialization function. Sets all of the initial parameters.

class MyCanvasBase(glcanvas.GLCanvas):

def __init__(self, parent):

glcanvas.GLCanvas.__init__(self, parent, -1)
print('Ia zdes')
self.init = False
print('Teper zdes')
# initial mouse position

self.lastx = self.x = 30

self.lasty = self.y = 30

self.size = None

self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground)

self.Bind(wx.EVT_SIZE, self.OnSize)

self.Bind(wx.EVT_PAINT, self.OnPaint)

self.Bind(wx.EVT_LEFT_DOWN, self.OnMouseDown)

self.Bind(wx.EVT_LEFT_UP, self.OnMouseUp)

self.Bind(wx.EVT_MOTION, self.OnMouseMotion)





def OnEraseBackground(self, event):

pass # Do nothing, to avoid flashing on MSW.





def OnSize(self, event):

size = self.size = self.GetClientSize()

if self.GetContext():

self.SetCurrent()

glViewport(0, 0, size.width, size.height)

event.Skip()





def OnPaint(self, event):

dc = wx.PaintDC(self)

self.SetCurrent()

if not self.init:

self.InitGL()

self.init = True

self.OnDraw()





def OnMouseDown(self, evt):

self.CaptureMouse()

self.x, self.y = self.lastx, self.lasty = evt.GetPosition()





def OnMouseUp(self, evt):

self.ReleaseMouse()





def OnMouseMotion(self, evt):

if evt.Dragging() and evt.LeftIsDown():

self.lastx, self.lasty = self.x, self.y

self.x, self.y = evt.GetPosition()
print(str(self.lastx),str(self.lasty))
self.Refresh(False)

class CubeCanvas(MyCanvasBase):

def InitGL(self):

# set viewing projection

glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glViewport(0,0,400,400)
glFrustum(-0.5, 0.5, -0.5, 0.5, 0.5, 10000.0)



# position viewer

glMatrixMode(GL_MODELVIEW)



glTranslatef(0.0, 0.0, -3.0)



# position object

# glRotatef(self.y, 1.0, 0.0, 0.0)

# glRotatef(self.x, 0.0, 1.0, 0.0)



glEnable(GL_DEPTH_TEST)

glEnable(GL_LIGHTING)

glEnable(GL_LIGHT0)





def OnDraw(self):

# clear color and depth buffers

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)


glNewList(1,GL_COMPILE)
# glColor3f(1.0, 0.0, 03.0)
glPushMatrix()
color = [1.0,1.,0.,1.]
glTranslatef(xrot,yrot,-1) # move z units out from the screen.

# glTranslatef(0.,1.,-10.) #move to where we want to put object
glMaterialfv(GL_FRONT,GL_DIFFUSE,color)
glutSolidSphere(1,32,32) # make radius 1 sphere of res 5x5
glPopMatrix()

glPushMatrix()
color = [0.0,1.,0.,1.]
glTranslatef(xrot,yrot,z) # move z units out from the screen.
# glTranslatef(0.,-3.,-10.) #move to where we want to put object
glMaterialfv(GL_FRONT,GL_DIFFUSE,color)
glutSolidSphere(1,32,32) # make radius 1 sphere of res 5x5
glPopMatrix()

glPushMatrix()
color = [0.0,1.,1.,1.]
# glTranslatef(xrot,yrot,z) # move z units out from the screen.
# glTranslatef(0.,-3.,-10.) #move to where we want to put object
glMaterialfv(GL_FRONT,GL_DIFFUSE,color)
glutSolidSphere(1,32,32) # make radius 1 sphere of res 5x5
glPopMatrix()

glEndList()



# if self.size is None:

# self.size = self.GetClientSize()

# w, h = self.size

# w = max(w, 1.0)

# h = max(h, 1.0)

# xScale = 180.0 / w

# yScale = 180.0 / h


glRotatef(0.5, 1.0, 0.0, 0.0)

# glRotatef((self.y - self.lasty) * yScale, 1.0, 0.0, 0.0);

# glRotatef((self.x - self.lastx) * xScale, 0.0, 1.0, 0.0);

# glTranslatef(0,0,-2)
glCallList(1)
glFlush()
self.SwapBuffers()

class MyFrame(wx.Frame):



def __init__(self):


# glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH)
# glutInitWindowSize(640, 480)
wx.Frame.__init__(self, None, -1, 'Test OpenGL', size=(800,600))



glutInit(sys.argv)
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH)

button_panel = wx.Panel(self, -1)

test=wx.Button(button_panel, -1, 'TEST',(10,10))
exit=wx.Button(button_panel, -1, 'Exit',(10,40))

gl_panel = CubeCanvas(self)

sizer = wx.BoxSizer(wx.HORIZONTAL)

sizer.Add(button_panel, 0, wx.ALL|wx.EXPAND, 5)


sizer.Add(gl_panel, 1, wx.ALL|wx.EXPAND, 5)
# self.Bind(wx.EVT_BUTTON, self.OnPlus, id=button1.GetId())
self.Bind(wx.EVT_BUTTON,self.OnExit,id=exit.GetId())

self.SetSizer(sizer)

def OnExit(self,event):
self.Close()






app = wx.App()

frame = MyFrame()

app.SetTopWindow(frame)

frame.Show(True)

app.MainLoop()
вот код для Work_with_glpanel.py:
try:
import wx
print (wx.VERSION_STRING)
from wx import glcanvas
except ImportError:
raise ImportError, "Required dependency wx.glcanvas not present"

try:
from OpenGL.GL import *
except ImportError:
raise ImportError, "Required dependency OpenGL not present"
from OpenGL.GLUT import *
from OpenGL.GLU import *
import sys
from math import sqrt
import random
ESCAPE = '\033'
SPACE = '\040'
ROT_X = '\061'
ROT_Y = '\062'
ROT_Z = '\063'
BACKSPACE = '\010'
ZOOM_IN = '\053'
ZOOM_OUT = '\055'
pause = 0
zoom = 22

xrot = 0.0
yrot = 0.0
zrot = 0.0

rot_x_en = 0
rot_y_en = 0
rot_z_en = 0

m_contr = 0
beginx = 0
beginy = 0

width=0
height=0


global points,glCoord,frame
points=[]

class glCoord():
def __init__(self):
self.x=0.0
self.y=0.0
self.z=0.0


class ballButton(wx.Button):
def __init__(self,parent):
self.init = False

# self.canvas.Bind(wx.EVT_LEFT_DOWN, self.OnMouseDown)
'''
def OnMouseDown(self, evt):
self.CaptureMouse()
self.x, self.y = evt.GetPosition()
print(self.x,self.y)
'''

class point(ballButton):
def __init__(self):
self.id=0
self.x = 0.5 + random.randrange(-5,5)
self.y = 0.5 + random.randrange(-5,5)
self.z = -1*random.randrange(-5,5)
self.active = random.randint(0,2)

def draw_point(self):
glPushMatrix()
glTranslatef(self.x,self.y,self.z)
if self.active == 1:
glColor3f(0.0, 1.0, 0.5)
else:
glColor3f(1.0, 0.0, 0.5)
glutSolidSphere(0.4, 10, 10)
glPopMatrix()



class GLFrame(wx.Frame):
"""A simple class for using OpenGL with wxPython."""

def __init__(self, parent, id, title, pos=wx.DefaultPosition,
size=(640,480), style=wx.DEFAULT_FRAME_STYLE,
name='frame',*args, **kwds):


self.frame1=wx.Frame(parent,-1, title="fir")
# self.frame=frame0(None,-1,title="fgfg")

self.dirname=''

self.lastx = self.x = 30
self.lasty = self.y = 30
for i in range(500):
points.append(point())
points[i].id=i
# print(i,points[i].id)
glutInit(sys.argv)

#
# Forcing a specific style on the window.
# Should this include styles passed?
style = wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE

super(GLFrame, self).__init__(parent, id, title, pos, size, style, name)

self.GLinitialized = False
attribList = (glcanvas.WX_GL_RGBA, # RGBA
glcanvas.WX_GL_DOUBLEBUFFER, # Double Buffered
glcanvas.WX_GL_DEPTH_SIZE, 24) # 24 bit

#
# Create the canvas
self.canvas = glcanvas.GLCanvas(self, attribList=attribList)

# Set the event handlers.
self.canvas.Bind(wx.EVT_ERASE_BACKGROUND, self.processEraseBackgroundEvent)
self.canvas.Bind(wx.EVT_SIZE, self.processSizeEvent)
self.canvas.Bind(wx.EVT_PAINT, self.processPaintEvent)
self.canvas.Bind(wx.EVT_MOTION,self.OnMouseMotion)

self.Bind(wx.EVT_CHAR_HOOK, self.onKey)

self.canvas.Bind(wx.EVT_RIGHT_DOWN, self.OnMouseDown)

button_panel = wx.Panel(self, -1)

test=wx.Button(button_panel, -1, 'TEST',(10,10))
exit=wx.Button(button_panel, -1, 'Exit',(10,40))

gl_panel = self.canvas

sizer = wx.BoxSizer(wx.HORIZONTAL)

sizer.Add(button_panel, 0, wx.ALL|wx.EXPAND, 5)


sizer.Add(gl_panel, 1, wx.ALL|wx.EXPAND, 5)
self.Bind(wx.EVT_BUTTON, self.OnPlus, id=test.GetId())
self.Bind(wx.EVT_BUTTON,self.OnExit,id=exit.GetId())

self.frame2=frame0(self.frame1,-1,title="Vtoroy")
# self.trame=MyFrame1(self)


self.SetAutoLayout(True)
self.SetSizer(sizer)
self.Layout()

# StatusBar
self.CreateStatusBar()

# Filemenu
filemenu = wx.Menu()

menuOpen = filemenu.Append(wx.ID_OPEN, "&Open"," Open a file ")
self.Bind(wx.EVT_MENU, self.OnOpen, menuOpen)

# Filemenu - About
menuitem = filemenu.Append(-1, "&About", "Information about this program")

self.Bind(wx.EVT_MENU, self.OnAbout, menuitem) # here comes the event-handler
# Filemenu - Separator
filemenu.AppendSeparator()

# Filemenu - Exit
menuitem = filemenu.Append(-1, "E&xit", "Terminate the program")
self.Bind(wx.EVT_MENU, self.OnExit, menuitem) # here comes the event-handler

# Menubar
menubar = wx.MenuBar()
menubar.Append(filemenu,"&File")
#--------------------------------------------------
# Filemenu
toolsmenu = wx.Menu()

# Filemenu - About
menuitem = toolsmenu.Append(-1, "&Work_panel", "Information about this program")

self.Bind(wx.EVT_MENU, self.OnWork_panel, menuitem) # here comes the event-handler
# Filemenu - Separator
toolsmenu.AppendSeparator()


# Menubar
# menubar = wx.MenuBar()

menubar.Append(toolsmenu,"&Tools")
self.SetMenuBar(menubar)

# Show
# self.Show(True)

def OnAbout(self,event):
message = "Using PyOpenGL in wxPython"
caption = "About PyOpenGL Example"
wx.MessageBox(message, caption, wx.OK)

def OnExit(self,event):

self.Close()

def OnWork_panel(self,event):
self.frame2.Show(True)

# self.Close()
def OnOpen(self,e):
""" Open a file"""
dlg = wx.FileDialog(self, "Choose a file", self.dirname, "", "*.*", wx.OPEN)
if dlg.ShowModal() == wx.ID_OK:
self.filename = dlg.GetFilename()
self.dirname = dlg.GetDirectory()
f = open(os.path.join(self.dirname, self.filename), 'r')
self.control.SetValue(f.read())
f.close()
dlg.Destroy()


def OnPlus(self,event):
print('Ia v onPluse')
# frame=wx.Frame(None, -1, 'first.py',size=(200,200),pos=(300,300),style=(noboard))


self.frame1.Show(True)



def OnMouseDown(self, evt):
# Glvoid *pixel
size = self.canvas.GetClientSize()

self.x, self.y = evt.GetPosition()

# size = self.GetClientSize()
w = size.width
h = size.height


s = glReadPixels(0, 0, size.width, size.height,GL_RGBA, GL_UNSIGNED_BYTE)

print(s)
# Scale mouse translations to object viewplane so object tracks with mouse
win_height = max( 1,h)
# obj_c = (self.x, self.y, 300.0)
obj_c = (points[1].x,points[1].y, points[1].z)
win = gluProject( obj_c[0], obj_c[1], obj_c[2] )
obj = gluUnProject( win[0], win[1] + 0.5 * win_height, win[2] )
# dist = math.sqrt( v3distsq( obj, obj_c ) )
# scale = abs( dist / ( 0.5 * win_height ) )

print(points[1].x,points[1].y, points[1].z)
print(win)
print(obj)





def GetGLExtents(self):
"""Get the extents of the OpenGL canvas."""
return self.canvas.GetClientSize()

def SwapBuffers(self):
"""Swap the OpenGL buffers."""
self.canvas.SwapBuffers()

#
# wxPython Window Handlers

def processEraseBackgroundEvent(self, event):
"""Process the erase background event."""
pass # Do nothing, to avoid flashing on MSWin

def processSizeEvent(self, event):
"""Process the resize event."""
if self.canvas.GetContext():
# Make sure the frame is shown before calling SetCurrent.
self.Show()
self.canvas.SetCurrent()

size = self.GetGLExtents()
self.OnReshape(size.width, size.height)
self.canvas.Refresh(False)
event.Skip()

def processPaintEvent(self, event):
"""Process the drawing event."""
self.canvas.SetCurrent()

# This is a 'perfect' time to initialize OpenGL ... only if we need to
if not self.GLinitialized:
size = self.GetGLExtents()
self.OnInitGL(size.width, size.height)
self.GLinitialized = True


self.OnDraw()
event.Skip()




def onKey(self, evt):
global zoom
if evt.GetKeyCode() == wx.WXK_DOWN:
print "Down key pressed"
if zoom > 0:
zoom = zoom - 1
elif evt.GetKeyCode() == wx.WXK_UP:
print "UP key pressed"
if zoom < 40:
zoom = zoom + 1
else:
evt.Skip()



def OnMouseMotion(self, evt):
global m_contr, beginx, beginy
global xrot, yrot, zrot, pause ,rot_x_en, rot_y_en, rot_z_en


#if m_contr == 1:

# glutPostRedisplay()

if evt.Dragging() and evt.LeftIsDown():

self.lastx, self.lasty = self.x, self.y
self.x, self.y = evt.GetPosition()
xrot = xrot + (self.y - beginy)
yrot = yrot + (self.x - beginx)
beginx = self.x
beginy = self.y

self.Refresh(False)

#
# GLFrame OpenGL Event Handlers

def OnInitGL(self,width,height):
# print(width,height)

glClearColor(0.0, 0.0, 0.0, 0.0) # This Will Clear The Background Color To Black
glClearDepth(1.0) # Enables Clearing Of The Depth Buffer
glDepthFunc(GL_LESS) # The Type Of Depth Test To Do
glEnable(GL_DEPTH_TEST) # Enables Depth Testing
glShadeModel(GL_SMOOTH) # Enables Smooth Color Shading

glMatrixMode(GL_MODELVIEW)
glLoadIdentity() # Reset The Projection Matrix
# Calculate The Aspect Ratio Of The Window
# glFrustum(-0.5, 0.5, -0.5, 0.5, 1.0, 150.0)
#-------Out first picture-----------------------------------------------------
glViewport(0, 0, width, height)

glMatrixMode(GL_PROJECTION)
glLoadIdentity()

gluPerspective(45.0, float(width)/float(height), 0.1, 100.0)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()
#------------------------------------------------------------------
glLightfv(GL_LIGHT0, GL_AMBIENT,
[0.1, 0.1, 0.1, 0.5])
glLightfv(GL_LIGHT0, GL_DIFFUSE,
[1.0, 1.0, 1.0, 1.0])
glLightfv(GL_LIGHT0, GL_POSITION,
[0.0, 10.0, 10.0, 1.0])
glEnable(GL_LIGHT0)
glEnable(GL_LIGHTING)
glEnable(GL_COLOR_MATERIAL)

def OnReshape(self, width,height):
"""Reshape the OpenGL viewport based on the dimensions of the window."""


glViewport(0, 0, width, height)

glMatrixMode(GL_PROJECTION)
glLoadIdentity()
# glOrtho(-0.5, 0.5, -0.5, 0.5, -1, 1)
gluPerspective(45.0, float(width)/float(height), 0.1, 100.0)
glMatrixMode(GL_MODELVIEW)
glLoadIdentity()







def OnDraw(self):
"Draw the window."
global xrot,yrot,zrot
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)

glMaterialfv(GL_FRONT, GL_AMBIENT,
[1.0, 0.0, 0.0, 1.0])
glMaterialfv(GL_FRONT, GL_DIFFUSE,
[0.1, 0.0, 0.6, 0.0])
glMaterialfv(GL_FRONT, GL_SPECULAR,
[0.7, 0.6, 0.8, 0.0])
glMaterialf(GL_FRONT, GL_SHININESS, 80)
glLoadIdentity()

glNewList(1,GL_COMPILE)
for i in range(500):
points[i].draw_point()
glEndList()

glLoadIdentity()
gluLookAt(0,0,zoom,0,0,0,0,1,0)

if pause == 0 :
if rot_x_en == 1:
xrot = xrot - 0.5
if rot_y_en == 1:
yrot = yrot - 0.5
if rot_z_en == 1:
zrot = zrot - 0.5
glRotatef(xrot,1,0,0)
glRotatef(zrot,0,0,1)
glRotatef(yrot,0,1,0)
# glTranslatef(0.0, 0.0, -5.0)


glCallList(1)
self.SwapBuffers()

class frame0(wx.Frame):
def __init__(self, parent,id,title):
wx.Frame.__init__(self, parent,-1,title="000000")
# GLFrame.__init__(self)
# super(frame0, self).__init__()
# gl_panel = parent.Show(True)
# print( super(frame0, self).x)

# def __init__(self,parent,id,pos=(300,300),size=(150,150),style=wx.FRAME_TOOL_WINDOW):
bpanel=wx.Panel(self,-1)

elem=wx.Button(bpanel,-1,'Element panel',(30,10))

sizer=wx.BoxSizer(wx.HORIZONTAL)

sizer.Add(bpanel, 0, wx.ALL|wx.EXPAND, 5)
# sizer.Add(gl_panel, 1, wx.ALL|wx.EXPAND, 5)

bpanel.Bind(wx.EVT_BUTTON,self.OnChoice,elem)

# gl_panel.Bind(wx.EVT_RIGHT_DOWN, self.OnMouseDown)



def OnChoice(self,event):
# Label=wx.StaticText('Ia get It')
self.text = wx.StaticText(self, -1, 'Label', (40, 60))
print('111')




app = wx.PySimpleApp()
frame = GLFrame(None, -1, 'GL Window')
frame.Show()

app.MainLoop()
app.Destroy()
'''
def getScreenToGLCoord(self,x,y):
""" Get openGL Canvas coordinates from screen coordinates.
When user pan/zoom and click on the canvas, this function will return correct (x,y) world coordinates. """
try:
projection = glGetDoublev( GL_PROJECTION_MATRIX)
modelview = glGetDoublev( GL_MODELVIEW_MATRIX )
viewport = glGetIntegerv( GL_VIEWPORT )

vz=glReadPixels(vx, vy, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT);

glCoord = gluUnProject( x, (viewport[3] - y), vz, modelview, projection,viewport)
return int(glCoord[0]), int(glCoord[1])

except:
return x, y
'''


'''
projection = glGetDoublev( GL_PROJECTION_MATRIX)

modelview = glGetDoublev( GL_MODELVIEW_MATRIX )
viewport = glGetIntegerv( GL_VIEWPORT )
glCoord = gluUnProject( self.x, (viewport[3] - self.y), 0, modelview, projection,viewport)
print(int(glCoord[0]),int(glCoord[1]),int(glCoord[2]))
'''
'''
# print(glCoord)

# self.x, self.y = getScreenToGLCoord(self,self.x,self.y)
# screen coordinates
# x, y = event.GetPosition()
# get correct world coordinates from screen coordinates
# pos = getScreenToGLCoord(event.GetPosition())

# wx,wy,wz = GLU.gluUnProject( xx,yy,winz=0)


# size = self.canvas.GetClientSize()

# self.x, self.y = evt.GetPosition()

print(self.x,self.y)
# print(size)

self.x = ((self.x / ((size.x - 1) / 2))-1)
self.y = -((self.y / ((size.y - 1) / 2))- 1)

print(size.x,size.y)
print(self.x,self.y)


for i in range (500):
# print(i)
# print(points[i].x)
# print(points[i].y)

if( (points[i].x==self.x) and (points[i].y==self.y)):
print("ok")
print(points[i].id)

self.Refresh(False)
'''
Как решить эту проблему по этапно?

Заранее спасибо за ответ .
С уважением Максим(Одесса)
Ferroman
1. Используйте тег code
2. Баг не “в питоне”, как вы изволили выразится, а, скорее всего, в wx библиотеке — насколько я вижу, это единственное отличие в окружениях машин.

Если вы имели в виду поиск багов в коде, то в особо запущенных случаях используют деббагер — pdb, в «чистом» виде или в обёртках, типа winpdb (Вот тут можно найти аналоги: http://wiki.python.org/moin/PythonDebuggers ).
Max_Odessa
Спасибо за ответ.
Вот что выдаёт встроенный дебагер eclipse : В class CubeCanvas(MyCanvasBase) функция def OnDraw(self) доходя до строчки self.SwapBuffers() вызывает файл glcanvas где на def

SwapBuffers(*args, **kwargs):
“”“SwapBuffers(self)”“”
return _glcanvas.GLCanvas_SwapBuffers(*args, **kwargs)

(Снимок3) выдаёт:
the error was ‘BadDrawable (invalid Pixmap or Window parameter)’.
(Details: serial 610 error_code 9 request_code 137 minor_code 8)

Что я должен из этого понять и как дебагер может вывести меня на библиотеку wx которую я должен заменить или исправить?
Ferroman
Так вот _glcanvas библиотека и есть нужная. Нужно смотреть внутрь GLCanvas_SwapBuffers, где там может быть ошибка.
Но я думаю, что ошибка уже в сишной библиотеке, поскольку _glcanvas, скорее всего, уже сама обёртка.

Я, кстати говоря, не рекомендую исправлять код в сторонних библиотеках. Думаю, проще поискать работающую версию глючной либы, а о ошибке сообщить разработчикам (если есть лежание то и с предложением как исправить).
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB