hi i ve got this errors
Traceback (most recent call last):
File "C:\Users\oscar\Documents\NetBeansProjects\latest\src\main.py",
line 251, in OnNewDocument
newo = drawkernel.skth.DrawArea(self.Notebook, -1)
File "C:\Users\oscar\Documents\NetBeansProjects\latest\src\drawkernel
\skth.py", line 13, in __init__
self._initBuffer()
File "C:\Users\oscar\Documents\NetBeansProjects\latest\src\drawkernel
\skth.py", line 126, in _initBuffer
self.drawContents(dc)
File "C:\Users\oscar\Documents\NetBeansProjects\latest\src\drawkernel
\skth.py", line 104, in drawContents
gdc = self.wrapDC(dc)
AttributeError: 'DrawArea' object has no attribute 'wrapDC'
but if i got defined the wrapDC just like this
self.wrapDC = lambda dc: dc
and then is called here...
def drawContents(self, dc):
self.PrepareDC(dc)
gdc = self.wrapDC(dc)#right here
ordered_selection = []
for obj in self.contents[::-1]:
if obj in self.selection:
obj.draw(gdc, True)
ordered_selection.append(obj)
else:
obj.draw(gdc, False)
if self.curTool is not None:
self.curTool.draw(gdc)
for obj in ordered_selection:
obj.drawHandles(gdc)
hi i ve got this errors
Traceback (most recent call last):
File "C:\Users\oscar\Documents\NetBeansProjects\latest\src\main.py",
line 251, in OnNewDocument
newo = drawkernel.skth.DrawArea(self.Notebook, -1)
File "C:\Users\oscar\Documents\NetBeansProjects\latest\src\drawkernel
\skth.py", line 13, in __init__
self._initBuffer()
File "C:\Users\oscar\Documents\NetBeansProjects\latest\src\drawkernel
\skth.py", line 126, in _initBuffer
self.drawContents(dc)
File "C:\Users\oscar\Documents\NetBeansProjects\latest\src\drawkernel
\skth.py", line 104, in drawContents
gdc = self.wrapDC(dc)
AttributeError: 'DrawArea' object has no attribute 'wrapDC'
no that ^^ but i can solve put it after the 'draw' def __init__() code
class.
but i dont know what is this if variable or array. i don't think that
is one array
self.tools = {
'select' : (self.selectIcon,
drawKernel.drawobjects.SelectDrawingTool()),
'line' : (self.lineIcon,
drawKernel.drawobjects.LineDrawingTool()),
'polygon' : (self.polygonIcon,
drawKernel.drawobjects.PolygonDrawingTool()),
'scribble': (self.scribbleIcon,
drawKernel.drawobjects.ScribbleDrawingTool()),
'rect' : (self.rectIcon,
drawKernel.drawobjects.RectDrawingTool()),
'ellipse' : (self.ellipseIcon,
drawKernel.drawobjects.EllipseDrawingTool()),
'text' : (self.textIcon,
drawKernel.drawobjects.TextDrawingTool())
}
but here is defined like array
def setCurrentTool(self, toolName):
toolIcon, tool = self.tools[toolName]#here
if self.curToolIcon is not None:
self.curToolIcon.SetValue(False)
Traceback (most recent call last):
File "C:\Users\oscar\Documents\NetBeansProjects\latest\src\main.py",
line 370, in <module>
Frame(None, -1, "Toon Dev Studio").Show()
File "C:\Users\oscar\Documents\NetBeansProjects\latest\src\main.py",
line 74, in __init__
self.setCurrentTool("select")
File "C:\Users\oscar\Documents\NetBeansProjects\latest\src\main.py",
line 357, in setCurrentTool
toolIcon, tool = self.tools[toolName]
AttributeError: 'Frame' object has no attribute 'tools'
no that ^^ but i can solve put it after the 'draw' def __init__() code
class.
but i dont know what is this if variable or array. i don't think that
is one array
self.tools = {
'select' : (self.selectIcon,
drawKernel.drawobjects.SelectDrawingTool()),
'line' : (self.lineIcon,
drawKernel.drawobjects.LineDrawingTool()),
'polygon' : (self.polygonIcon,
drawKernel.drawobjects.PolygonDrawingTool()),
'scribble': (self.scribbleIcon,
drawKernel.drawobjects.ScribbleDrawingTool()),
'rect' : (self.rectIcon,
drawKernel.drawobjects.RectDrawingTool()),
'ellipse' : (self.ellipseIcon,
drawKernel.drawobjects.EllipseDrawingTool()),
'text' : (self.textIcon,
drawKernel.drawobjects.TextDrawingTool())
}
this is a dictionary -- indexed by a string: the name of the tool.
this is pretty basic python stuff -- you really do need to "get" how OO works in Python in order to use wxPython. "self" is the convention for the name of the current instance of an object -- since it is a convention, just seeing the line:
self.something = ...
doesn't tell us a thing about what class that is defined in.
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception