Transcript warning in MVC

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Transcript warning in MVC

Casey Ransberger-2
I've been using MVC. It's still buggy, but mostly usable. I thought that if someone just used it for a little while, we'd know where most of the worst bugs are.

Currently tracking two issues, one with errors occurring after bringing up context menus (haven't started really digging on that one yet,) and a warning which appears for reasons unknown in the Transcript. This is about the latter.

Warning: view contents not found.

I spent probably ten minutes sifting through all of the methods containing the string 'Warning:' when the whole string didn't turn up any hits, and I do think I have a lead.

It looks like the latter issue is occurring in StandardSystemView>>setUpdatablePanesFrom:, but I'm not sure why yet. The method itself seems pretty straightforward, but for some reason, the block temp aPane is ending up nil.

If I'm reading this right, aPane is assigned the value of sending #subViewSatisfying: to a StandardSystemView (in this case, self,) and the argument seems to be a block specifying a constraint, and I may as well paste in the send.

aPane := self subViewSatisfying:
[:pane | (pane isKindOf: PluggableListView) and: [pane getListSelector == sel]].

This happens right before the nil check, which probably means that the constraint doesn't match whatever #subViewSatisfying: searches (or #subViewSatisfying: is just borked.)

View>>#subViewSatisfying: is trivial, and indeed returns nil on no-match. The variable subViews just doesn't have what the method is looking for. I set a breakpoint in order to learn what was actually in there, but alas: it doesn't repro when I'm looking, which is more or less an "all stop" for me on this one.

Does anyone know this code well?

TIA,

Casey



Reply | Threaded
Open this post in threaded view
|

Re: Transcript warning in MVC

Chris Muller-3
UI code can be notoriously difficult to debug, eh?  One primitive tool
I sometimes use is a good ol'e Smalltalk global, say #X.  I make it an
OrderedCollection and then, in #setUpdatablePanesFrom:, just before it
prints to the Transcript, add in this line:

  X add: thisContext longStack.

Or,

  X add: { thisContext longStack. subViews copy }

can sometimes give some clues.


On Sat, Sep 13, 2014 at 11:35 PM, Casey Ransberger
<[hidden email]> wrote:

> I've been using MVC. It's still buggy, but mostly usable. I thought that if
> someone just used it for a little while, we'd know where most of the worst
> bugs are.
>
> Currently tracking two issues, one with errors occurring after bringing up
> context menus (haven't started really digging on that one yet,) and a
> warning which appears for reasons unknown in the Transcript. This is about
> the latter.
>
> Warning: view contents not found.
>
> I spent probably ten minutes sifting through all of the methods containing
> the string 'Warning:' when the whole string didn't turn up any hits, and I
> do think I have a lead.
>
> It looks like the latter issue is occurring in
> StandardSystemView>>setUpdatablePanesFrom:, but I'm not sure why yet. The
> method itself seems pretty straightforward, but for some reason, the block
> temp aPane is ending up nil.
>
> If I'm reading this right, aPane is assigned the value of sending
> #subViewSatisfying: to a StandardSystemView (in this case, self,) and the
> argument seems to be a block specifying a constraint, and I may as well
> paste in the send.
>
> aPane := self subViewSatisfying:
> [:pane | (pane isKindOf: PluggableListView) and: [pane getListSelector ==
> sel]].
>
> This happens right before the nil check, which probably means that the
> constraint doesn't match whatever #subViewSatisfying: searches (or
> #subViewSatisfying: is just borked.)
>
> View>>#subViewSatisfying: is trivial, and indeed returns nil on no-match.
> The variable subViews just doesn't have what the method is looking for. I
> set a breakpoint in order to learn what was actually in there, but alas: it
> doesn't repro when I'm looking, which is more or less an "all stop" for me
> on this one.
>
> Does anyone know this code well?
>
> TIA,
>
> Casey
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Transcript warning in MVC

Casey Ransberger-2
Thanks for the tip. I didn't know I could get the stack by sending a message to thisContext, but it makes perfect sense. That'll be useful all over the place.

As for debugging in UIs: when I started playing around with the idea of "desktop themes" in Cuis, I definitely saw the precarious relationship between the debugger and the graphics system that renders it. When you're changing the behavior of (say) SystemWindow, and you botch something, you get… a debugger, attempting to render itself, encountering the bug you've introduced, popping a new debugger, rinse-repeat until the screen is completely full of broken debuggers and you force-quit the VM in defeat! Which in Cuis happened *crazy* fast, even on the interpreter.

Of course, the benefits of system-implemented-in-itself generally dwarf the drawbacks. One learns new ways of working and gets used to the sticky parts. I remember when I first got started, and I wanted to rename a class variable in the UI, I was like "how in the hell do I do this without breaking stuff?" It wasn't hard to realize that I could just create a new variable, stick the value in it, point everything that uses it at the new variable, and fire torpedoes into the old one, but growing up with mostly write-compile-coffee-lunch-debug had hobbled my thinking.

Anyway MVC beats the pants off of Squeak's Morphic implementation at the track, so I think it makes sense to use it for web heads, databases, stuff like that where generally no-one is actually using the UI most of the time. It seems like the most sensible tool to use in making Morphic re/unloadable, at least for now (though I've thought a bit about eventually getting rid of both and using the telnet-thingy in OSProcess, or possibly remote messaging/debugging.)

That awkward moment when one realizes that the murky road less travelled by was once the only thoroughfare in the world.

Casey


On Mon, Sep 15, 2014 at 2:33 PM, Chris Muller <[hidden email]> wrote:
UI code can be notoriously difficult to debug, eh?  One primitive tool
I sometimes use is a good ol'e Smalltalk global, say #X.  I make it an
OrderedCollection and then, in #setUpdatablePanesFrom:, just before it
prints to the Transcript, add in this line:

  X add: thisContext longStack.

Or,

  X add: { thisContext longStack. subViews copy }

can sometimes give some clues.


On Sat, Sep 13, 2014 at 11:35 PM, Casey Ransberger
<[hidden email]> wrote:
> I've been using MVC. It's still buggy, but mostly usable. I thought that if
> someone just used it for a little while, we'd know where most of the worst
> bugs are.
>
> Currently tracking two issues, one with errors occurring after bringing up
> context menus (haven't started really digging on that one yet,) and a
> warning which appears for reasons unknown in the Transcript. This is about
> the latter.
>
> Warning: view contents not found.
>
> I spent probably ten minutes sifting through all of the methods containing
> the string 'Warning:' when the whole string didn't turn up any hits, and I
> do think I have a lead.
>
> It looks like the latter issue is occurring in
> StandardSystemView>>setUpdatablePanesFrom:, but I'm not sure why yet. The
> method itself seems pretty straightforward, but for some reason, the block
> temp aPane is ending up nil.
>
> If I'm reading this right, aPane is assigned the value of sending
> #subViewSatisfying: to a StandardSystemView (in this case, self,) and the
> argument seems to be a block specifying a constraint, and I may as well
> paste in the send.
>
> aPane := self subViewSatisfying:
> [:pane | (pane isKindOf: PluggableListView) and: [pane getListSelector ==
> sel]].
>
> This happens right before the nil check, which probably means that the
> constraint doesn't match whatever #subViewSatisfying: searches (or
> #subViewSatisfying: is just borked.)
>
> View>>#subViewSatisfying: is trivial, and indeed returns nil on no-match.
> The variable subViews just doesn't have what the method is looking for. I
> set a breakpoint in order to learn what was actually in there, but alas: it
> doesn't repro when I'm looking, which is more or less an "all stop" for me
> on this one.
>
> Does anyone know this code well?
>
> TIA,
>
> Casey
>
>
>
>




Reply | Threaded
Open this post in threaded view
|

re: Transcript warning in MVC

ccrraaiigg

> That awkward moment when one realizes that the murky road less
> travelled by was once the only thoroughfare in the world.

     Yes; if you squint, you can see the Roman wheel tracks. :)


-C

--
Craig Latta
netjam.org
+31   6 2757 7177 (SMS ok)
+ 1 415  287 3547 (no SMS)


Reply | Threaded
Open this post in threaded view
|

re: Transcript warning in MVC

Casey Ransberger-2
Are we tracking different animals? Because the only tracks I've been able to track while tracking have been from tires of cars from the 20th century.

Confused,

Casey:P

> On Sep 16, 2014, at 3:27 AM, Craig Latta <[hidden email]> wrote:
>
>
>> That awkward moment when one realizes that the murky road less
>> travelled by was once the only thoroughfare in the world.
>
>     Yes; if you squint, you can see the Roman wheel tracks. :)
>
>
> -C
>
> --
> Craig Latta
> netjam.org
> +31   6 2757 7177 (SMS ok)
> + 1 415  287 3547 (no SMS)
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Transcript warning in MVC

David T. Lewis
In reply to this post by Chris Muller-3
On Mon, Sep 15, 2014 at 04:33:55PM -0500, Chris Muller wrote:

> UI code can be notoriously difficult to debug, eh?  One primitive tool
> I sometimes use is a good ol'e Smalltalk global, say #X.  I make it an
> OrderedCollection and then, in #setUpdatablePanesFrom:, just before it
> prints to the Transcript, add in this line:
>
>   X add: thisContext longStack.
>
> Or,
>
>   X add: { thisContext longStack. subViews copy }
>
> can sometimes give some clues.
>

As long as we are confessing our hacks for debugging MVC, I also use
OSProcess class>>trace: to spit debugging messages to the console without
interfering with the MVC user interface.

Dave


Reply | Threaded
Open this post in threaded view
|

re: Transcript warning in MVC

ccrraaiigg

> As long as we are confessing our hacks for debugging MVC, I also use
> OSProcess class>>trace: to spit debugging messages to the console
> without interfering with the MVC user interface.

     Good one... Also, MVC runs fast enough in the VM simulator on my
machine that I sometimes just do that. A remote debugger from another
system is good, too.


-C

--
Craig Latta
netjam.org
+31   6 2757 7177 (SMS ok)
+ 1 415  287 3547 (no SMS)