Hi,
sometimes I have a PluggableListMorph that displays a big red square (see attached screenshot). How can I debug why this happens ? Cheers, Laurent
|
In pharo2.0 you can click on it and it opens a debugger.
Stef On Nov 4, 2012, at 6:04 PM, laurent laffont wrote: > Hi, > > sometimes I have a PluggableListMorph that displays a big red square (see attached screenshot). How can I debug why this happens ? > > <image.png> > > Cheers, > > Laurent |
In reply to this post by laurent laffont
In Pharo 1.4, browse Morph
Find the method fullDrawOn: and replace on: Error do: [:err | self setProperty: #errorOnDraw toValue: true. self setProperty: #drawError toValue: err freeze. ^ self drawErrorOn: aCanvas ] by: value Now you will have a debugger instead of the red square of death But do it at you own risk ^^ Ben On Nov 4, 2012, at 6:04 PM, laurent laffont wrote: > Hi, > > sometimes I have a PluggableListMorph that displays a big red square (see attached screenshot). How can I debug why this happens ? > > <image.png> > > Cheers, > > Laurent |
Thanks for the tip !
Laurent
On Sun, Nov 4, 2012 at 6:37 PM, Benjamin <[hidden email]> wrote: In Pharo 1.4, browse Morph |
In reply to this post by Stéphane Ducasse
Cool :)
Laurent
On Sun, Nov 4, 2012 at 6:13 PM, Stéphane Ducasse <[hidden email]> wrote: In pharo2.0 you can click on it and it opens a debugger. |
In reply to this post by Benjamin Van Ryseghem (Pharo)
Excellent tip!!
Alexandre On Nov 4, 2012, at 2:37 PM, Benjamin <[hidden email]> wrote: > In Pharo 1.4, browse Morph > Find the method fullDrawOn: > > and replace > > on: Error do: [:err | > self setProperty: #errorOnDraw toValue: true. > self setProperty: #drawError toValue: err freeze. > ^ self drawErrorOn: aCanvas > ] > > by: > value > > Now you will have a debugger instead of the red square of death > > But do it at you own risk ^^ > Ben > > On Nov 4, 2012, at 6:04 PM, laurent laffont wrote: > >> Hi, >> >> sometimes I have a PluggableListMorph that displays a big red square (see attached screenshot). How can I debug why this happens ? >> >> <image.png> >> >> Cheers, >> >> Laurent > > -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. |
In reply to this post by Benjamin Van Ryseghem (Pharo)
On 04.11.2012 18:37, Benjamin wrote:
> In Pharo 1.4, browse Morph > Find the method fullDrawOn: > > and replace > > on: Error do: [:err | > self setProperty: #errorOnDraw toValue: true. > self setProperty: #drawError toValue: err freeze. > ^ self drawErrorOn: aCanvas > ] > > by: > value > > Now you will have a debugger instead of the red square of death > > But do it at you own risk ^^ > Ben > haltOnce instead, or risk losing the image :) Cheers, Henry |
>>
>> > Debugging UI code is one of those places you probably want to insert a haltOnce instead, or risk losing the image :) and event :) and shortcut code :) |
In reply to this post by laurent laffont
Hi Laurent,
let me share my way of solving this. My method works from a Workspace or Inspector/Explorer. What I do is invoke "drawOn:" manually, passing a NullCanvas (a "dummy" canvas).
Suppose I have a reference (in a Workspace/Inspector) for my buggy morph, called "m": m drawOn: (NullCanvas new). This should trigger the debugger and show you the error. You can then debug, explore, fix, change, etc. Repeat as needed. Even if the bug is fixed, the Morph stays in this "erroneous" state. That's why when the bug is fixed you should call "resumeAfterDrawError" on your Morph:
m resumeAfterDrawError. And it will re-draw it again. Hope it helps, Sebastian
2012/11/4 laurent laffont <[hidden email]> Hi, |
Neat trick!
> Suppose I have a reference (in a Workspace/Inspector) for my buggy morph, called "m": > > m drawOn: (NullCanvas new). > > This should trigger the debugger and show you the error. You can then debug, explore, fix, change, etc. Repeat as needed. Even if the bug is fixed, the Morph stays in this "erroneous" state. That's why when the bug is fixed you should call "resumeAfterDrawError" on your Morph: > > m resumeAfterDrawError. > > And it will re-draw it again. |
Administrator
|
The debugging tricks in this thread were too good! I added them to the fogbugz wiki https://pharo.fogbugz.com/default.asp?W84
Cheers,
Sean |
Free forum by Nabble | Edit this page |