VA 7.x, Windows XP, Redraw with lots of icons gets mad ...

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

VA 7.x, Windows XP, Redraw with lots of icons gets mad ...

Postby marten » Thu Nov 09, 2006 2:22 am

I posted this error perhaps last year or so - but again I got this behaviour today, when I played with one of my applications.

I have a window with a WkHierarchicalListBox widget and lots of little icons shown in the tree view within this widget. This all is done under Windows XP with XP2 (now with ATI graphic card - which is a new one, before that I had a Matrox card).

My desktop settings are set in the way, that the window content IS shown, when I move or resize a window.

Now when I resize this window (from the lower right corner) very fast (making it smaller and larger again) for some times I get the following error:





Code: Select all
Debugger Stack Trace Report:
Error String: 'Unable to allocate device context.'
Resumable: false

UIProcess
   Name: (09.11.2006 11:27:11)
   Process State: suspended
   Priority: 7

Executing in: CgPixmap(CgDrawable)>>#errorBadDC

System Configuration Dump


Copyright:

   VA Smalltalk Enterprise, V7.0.1
   (C) Copyright Instantiations, Inc., 1994, 2006.  All Rights Reserved.
   (C) Copyright IBM Corporation, 1994, 2006.  All Rights Reserved.
   VM Timestamp: 4.0,(NC) 10/24/2006 (71)
   
   PUM 2 (Poor Users Modelling And Source Code Generator 2)
   Written by Marten Feldtmann, 2003, 2006

Time:  11:27:50
Date:  09.11.2006

Platform:

   Virtual machine:  ES
   Bytecode version:  4.0
   Manager version:  4.00
   'OS' subsystem:  'WIN32s'
   'CLIM' subsystem:  'ES'
   'CP' subsystem:  'WIN32s'
   'CLDT' subsystem:  'ES'
   'CFS' subsystem:  'WIN32s'
   'SCI' subsystem:  'WIN'
   'CW' subsystem:  'WIN32s'
   'CPM' subsystem:  'ES'
   'CG' subsystem:  'WIN32s'
   'CPIC' subsystem:  'WIN32s'

Current user:  Marten Feldtmann

Connected Library:

   Pathname:  E:\Programme\vast70\manager\mgr70.dat

INFO: Trapped error dumping system configuration.
=============<STACK TRACE BEGINS>============
[] in <optimized block>(ExceptionalEvent class)>>#initializeSystemExceptions
   signal=Signal on Exception: (ExError) An error has occurred.
Signal>>#evaluate:
   self=Signal on Exception: (ExError) An error has occurred.
   aBlock=[] in ExceptionalEvent class>>#initializeSystemExceptions
ExceptionalEvent>>#applyDefaultHandler:
   self=Exception: (ExError) An error has occurred.
   aSignal=Signal on Exception: (ExError) An error has occurred.
   exception=Exception: (ExError) An error has occurred.
ExceptionalEvent>>#signalWithArguments:
   self=Exception: (ExError) An error has occurred.
   arguments=('Unable to allocate device context.')
   signal=Signal on Exception: (ExError) An error has occurred.
   handler=nil
ExceptionalEvent>>#signalWith:
   self=Exception: (ExError) An error has occurred.
   arg1='Unable to allocate device context.'
CgPixmap(Object)>>#error:
   self=a CgPixmap
   aString='Unable to allocate device context.'
CgPixmap(CgDrawable)>>#errorBadDC
   self=a CgPixmap
CgPixmap>>#getDC
   self=a CgPixmap
   hDC=OSHdc {0}
CgPixmap(CgDrawable)>>#deviceContextDo:
   self=a CgPixmap
   aBlock=[] in CgGC>>#copyArea:srcX:srcY:width:height:destX:destY:
   hDC=nil
CgGC>>#copyArea:srcX:srcY:width:height:destX:destY:
   self=a CgGC
   src=a CgPixmap
   srcX=0
   srcY=0
   width=9
   height=9
   destX=2
   destY=131
   w=9
   h=9
CgPixmap(CgDrawable)>>#copyArea:gc:srcX:srcY:width:height:destX:destY:
   self=a CgPixmap
   dest=a CgWindow
   gc=a CgGC
   srcX=0
   srcY=0
   width=9
   height=9
   destX=2
   destY=131
CgPixmap>>#ewDrawUsing:
   self=a CgPixmap
   anEwRenderContext=an EwRenderContext
EwIconHierarchyPolicy>>#drawIcon:using:
   self=an EwIconHierarchyPolicy
   anIcon=a CgPixmap
   anRC=an EwRenderContext
   wIcon=9
   hIcon=9
   xOld=0
   yOld=126
   wOld=13
   hOld=18
EwIconHierarchyPolicy>>#drawIconUsing:node:
   self=an EwIconHierarchyPolicy
   anRC=an EwRenderContext
   aTreeNode=an EwTableTreeNode
   icon=a CgPixmap
EwIconHierarchyPolicy>>#drawUsing:node:
   self=an EwIconHierarchyPolicy
   anRC=an EwRenderContext
   aTreeNode=an EwTableTreeNode
EwIconHierarchyPolicy(EwHierarchyPolicy)>>#drawUsing:in:node:
   self=an EwIconHierarchyPolicy
   anRC=an EwRenderContext
   aRect=0 @ 130 corner: 194 @ 160
   aTreeNode=an EwTableTreeNode
   wOld=13
EwTableTreeNode>>#partialDrawUsing:in:
   self=an EwTableTreeNode
   anRC=an EwRenderContext
   aRect=0 @ 130 corner: 194 @ 160
StsHierarchyList(EwTableList)>>#partialDrawItemAt:x:y:width:height:damagedRectangle:
   self=a StsHierarchyList
   index=87
   x=0
   y=126
   width=258
   height=18
   damagedRectangle=0 @ 130 corner: 194 @ 160
   node=an EwTableTreeNode
   realSelectedState=false
StsHierarchyList(EwTableList)>>#partialDrawRangeFrom:to:y:damagedRectangle:
   self=a StsHierarchyList
   firstItem=87
   lastItem=88
   yStart=126
   damagedRectangle=0 @ 130 corner: 194 @ 160
   y=126
   itemHeight=18
   yLimit=160
   x=0
   width=258
   visibleIndex=8
   node=an EwTableTreeNode
   index=87
StsHierarchyList(EwTableList)>>#drawRangeFrom:to:y:damagedRectangle:
   self=a StsHierarchyList
   firstItem=87
   lastItem=88
   yStart=126
   damagedRectangle=0 @ 130 corner: 194 @ 160
   y=126
   yLimit=nil
   x=nil
   width=nil
   renderContext=nil
   offset=nil
StsHierarchyList(EwLinearList)>>#exposeRectangle:
   self=a StsHierarchyList
   aRectangle=0 @ 130 corner: 194 @ 160
   start=87
StsHierarchyList(EwScrollable)>>#expose:clientData:callData:
   self=a StsHierarchyList
   widget=CwDrawingArea(applications_DrawingArea)
   clientData=nil
   callData=CwDrawingCallbackData(
    reason -> 38
    window -> a CgWindow
    event -> a CwExposeEvent
)
StsHierarchyList(EwList)>>#expose:clientData:callData:
   self=a StsHierarchyList
   widget=CwDrawingArea(applications_DrawingArea)
   clientData=nil
   callData=CwDrawingCallbackData(
    reason -> 38
    window -> a CgWindow
    event -> a CwExposeEvent
)
StsHierarchyList(EwLinearList)>>#expose:clientData:callData:
   self=a StsHierarchyList
   widget=CwDrawingArea(applications_DrawingArea)
   clientData=nil
   callData=CwDrawingCallbackData(
    reason -> 38
    window -> a CgWindow
    event -> a CwExposeEvent
)
StsHierarchyList(EwTableList)>>#expose:clientData:callData:
   self=a StsHierarchyList
   widget=CwDrawingArea(applications_DrawingArea)
   clientData=nil
   callData=CwDrawingCallbackData(
    reason -> 38
    window -> a CgWindow
    event -> a CwExposeEvent
)
CwCallbackRec>>#callWith:callData:
   self=a CwCallbackRec
   aWidget=CwDrawingArea(applications_DrawingArea)
   callData=CwDrawingCallbackData(
    reason -> 38
    window -> a CgWindow
    event -> a CwExposeEvent
)
CwDrawingArea(CwBasicWidget)>>#callCallbackList:callData:
   self=CwDrawingArea(applications_DrawingArea)
   aCallbackList=OrderedCollection(a CwCallbackRec )
   callData=CwDrawingCallbackData(
    reason -> 38
    window -> a CgWindow
    event -> a CwExposeEvent
)
   callbacks=nil
   size=1
   rec1=nil
   rec2=nil
   rec3=nil
CwDrawingArea(CwComposite)>>#callExpose:
   self=CwDrawingArea(applications_DrawingArea)
   anEvent=an OSExpose
   exposeEvent=a CwExposeEvent
   callData=CwDrawingCallbackData(
    reason -> 38
    window -> a CgWindow
    event -> a CwExposeEvent
)
OSComposite(OSWidget)>>#callHandlers:with:
   self=OSComposite()
   handlers=#callExpose:
   data=an OSExpose
OSComposite(OSWidget)>>#event:data:deferred:
   self=OSComposite()
   anEvent=10
   data=an OSExpose
   deferred=false
   handlers=#callExpose:
OSComposite(OSWidget)>>#sendEvent:data:
   self=OSComposite()
   anEventType=10
   data=an OSExpose
OSComposite(OSWidget)>>#exposeRect:
   self=OSComposite()
   aRect=0 @ 130 corner: 194 @ 160
   data=an OSExpose
OSComposite(OSWidget)>>#exposeOSRect:
   self=OSComposite()
   aRect=*OSRect {
left: 0
top: 130
right: 194
bottom: 160
}
[] in OSComposite>>#wmPaint:with:
   self=OSComposite()
   rect=*OSRect {
left: 0
top: 130
right: 194
bottom: 160
}
OSComposite(OSWidget)>>#paintDo:
   self=OSComposite()
   aBlock=[] in OSComposite>>#wmPaint:with:
   hDC=OSHdc {16842839}
   oldDC=nil
   struct=*OSPaintstruct {
hdc: OSHdc {16842836}
fErase: false
rcPaint: *OSRect {
left: 9
top: 264
right: 127
bottom: 424
}
fRestore: false
fIncUpdate: false
rgbReserved: OSUInt8 [32] {160 7 1 122 36 183 234 244 222 117 131 191 192 184 161 133 52 183 234 244 77 119 131 191 112 93 108 188 240 255 255 255}
}
   rcPaint=*OSRect {
left: 0
top: 130
right: 194
bottom: 160
}
   state=false
OSComposite>>#paintDo:
   self=OSComposite()
   aBlock=[] in OSComposite>>#wmPaint:with:
   state=nil
   oldStyle=nil
   newStyle=nil
OSComposite>>#wmPaint:with:
   self=OSComposite()
   wParam=0
   lParam=0
OSComposite(OSWidget)>>#windowProc:with:with:
   self=OSComposite()
   msg=15
   arg1=0
   arg2=0
   selector=#wmPaint:with:
   result=nil
OSEventManager class>>#windowProc:msg:with:with:
   self=OSEventManager
   hwnd=459748
   msg=15
   arg1=0
   arg2=0
   object=OSComposite()
OSHwnd>>#defWindowProc:wParam:lParam:
   self=OSHwnd {1180340}
   msg=274
   wParam=61448
   lParam=28574262
OSShell(OSComposite)>>#callWindowProc:with:with:
   self=OSShell(PUM (Poor Users Modeler V7.0.0 - Alpha 0053 - 08.11.2006)
   msg=274
   wParam=61448
   lParam=28574262
OSShell(OSWidget)>>#windowProc:with:with:
   self=OSShell(PUM (Poor Users Modeler V7.0.0 - Alpha 0053 - 08.11.2006)
   msg=274
   arg1=61448
   arg2=28574262
   selector=#wmSyscommand:with:
   result=nil
OSEventManager class>>#windowProc:msg:with:with:
   self=OSEventManager
   hwnd=1180340
   msg=274
   arg1=61448
   arg2=28574262
   object=OSShell(PUM (Poor Users Modeler V7.0.0 - Alpha 0053 - 08.11.2006)
OSHwnd>>#defWindowProc:wParam:lParam:
   self=OSHwnd {1180340}
   msg=161
   wParam=17
   lParam=28574262
OSShell(OSComposite)>>#callWindowProc:with:with:
   self=OSShell(PUM (Poor Users Modeler V7.0.0 - Alpha 0053 - 08.11.2006)
   msg=161
   wParam=17
   lParam=28574262
OSShell(OSWidget)>>#windowProc:with:with:
   self=OSShell(PUM (Poor Users Modeler V7.0.0 - Alpha 0053 - 08.11.2006)
   msg=161
   arg1=17
   arg2=28574262
   selector=nil
   result=nil
OSEventManager class>>#windowProc:msg:with:with:
   self=OSEventManager
   hwnd=1180340
   msg=161
   arg1=17
   arg2=28574262
   object=OSShell(PUM (Poor Users Modeler V7.0.0 - Alpha 0053 - 08.11.2006)
OSMsg>>#dispatchMessage
   self=*OSMsg {
hwnd: OSHwnd {1250210}
message: 273
wParam: 365
lParam: 0
time: 5078671
pt: *OSPoint {
x: 392
y: 262
}
}
OSEventManager class>>#dispatchEvent
   self=OSEventManager
   state=false
OSWidget class>>#readAndDispatch
   self=OSWidget
   state=true
   gotEvent=true
CwAppContext>>#readAndDispatch
   self=a CwAppContext
AbtWindowSystemStartUp class(EsWindowSystemStartUp class)>>#messageLoop
   self=AbtWindowSystemStartUp
   lastEventTime=5042437
   appContext=a CwAppContext
[] in <optimized block>(UIProcess class)>>#forkUserInterface
[] in UIProcess(Process)>>#executeBlock:withArguments:
   self=UIProcess:(09.11.2006 11:22:34){dead,3}
   aBlock=[] in UIProcess class>>#forkUserInterface
   args=()
UIProcess(Process)>>#executeBlock:withArguments:
   self=UIProcess:(09.11.2006 11:22:34){dead,3}
   aBlock=[] in UIProcess class>>#forkUserInterface
   args=()
UIProcess(Process)>>#newProcessOn:stackSize:withArguments:named:
   self=UIProcess:(09.11.2006 11:22:34){dead,3}
   aBlock=[] in UIProcess class>>#forkUserInterface
   stackSize=1024
   args=()
   procName='(09.11.2006 11:22:34)'
==============<STACK TRACE ENDS>=============
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Re: VA 7.x, Windows XP, Redraw with lots of icons gets mad .

Postby marten » Thu Nov 09, 2006 11:08 am

marten wrote:I posted this error perhaps last year or so - but again I got this behaviour today, when I played with one of my applications.

I have a window with a WkHierarchicalListBox widget and lots of little icons shown in the tree view within this widget. This all is done under Windows XP with XP2 (now with ATI graphic card - which is a new one, before that I had a Matrox card).

My desktop settings are set in the way, that the window content IS shown, when I move or resize a window.

Now when I resize this window (from the lower right corner) very fast (making it smaller and larger again) for some times I get the following error:



Just to add one additional information - whenever this happens the WkHierarchicalListBox widget (and only this widget from the whole window) is painted (redrawed) at the upper left corner of the screen - and it does not matter, where my window (containing thins widget) is.

Marten
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Postby tstalzer » Sat Nov 11, 2006 8:52 am

Hi Marten

I had a similar problem in the standard icon tree view. It actually is an "out-of-memory" condition.

The problem was on my side. On every "visualInfoRequest:" I reloaded the icon. However, I did not "free" the old one. Eventually, I ended up in caching the icons and reusing them.

--Thomas
tstalzer
[|]
 
Posts: 65
Joined: Mon Oct 16, 2006 12:07 am
Location: Palma de Mallorca - Spain

Postby marten » Sat Nov 11, 2006 9:23 am

tstalzer wrote:Hi Marten

I had a similar problem in the standard icon tree view. It actually is an "out-of-memory" condition.

The problem was on my side. On every "visualInfoRequest:" I reloaded the icon. However, I did not "free" the old one. Eventually, I ended up in caching the icons and reusing them.

--Thomas


I thought, that WbIcon does this - but actually looking at that class, I'm not sure any more ....
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

VA 7.x, Windows XP, Redraw with lots of icons gets mad ...

Postby solveig » Tue Nov 14, 2006 6:51 am

Hi, Marten,

VA Smalltalk keeps up the VAST tradition that the creator of an icon (or any other object holding onto external resources) is responsible for freeing those external resources.

Solveig
solveig
Moderator
 
Posts: 57
Joined: Tue Oct 17, 2006 6:30 am

Postby Bob Nemec » Wed Nov 15, 2006 11:58 am

FWIW: we store our icons in the image. They're build once from byte array methods and then cached. The technique has worked well for the past six years. It's based on StsImageManager. We added some tools to managing the icons easier. It stores 16x16 and 32x32 icons, plus a few bitmaps.

It all just comes down to...

shape := self perform: shapeMethod.
mask := self perform: maskMethod.

^CgIcon
width: anInteger (16 or 32)
height: anInteger (16 or 32)
depth: 4
palette: self newIndexedPalette (we limit the icons to one palette)
shapePad: 4
shapeData: shape
maskPad: 4
maskData: mask

The byte array methods are created by first building an icon...
CgIcon fromFile: fullFilename size: 16@16. and them compiling method source from the icon #shapeDate and #maskData
Bob Nemec
Northwater Capital
Bob Nemec
[|]
 
Posts: 16
Joined: Mon Oct 16, 2006 5:07 am


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: No registered users and 1 guest