[Pharo-project] Issue 3090: Context not included in ImageSegment when saving morph to file

Eliot Miranda eliot.miranda at gmail.com
Fri Oct 29 22:40:42 EDT 2010


On Thu, Oct 28, 2010 at 11:27 PM, Adrian Lienhard <adi at netstyle.ch> wrote:

> Ok, this is not related to closures. Polymorph uses blocks, e.g., for the
> addUpAction of a  MultistateButtonMorph (in this case the block is created
> in UIThemeWatery>>#createCloseBoxFor:). And blocks are not serializable with
> reference streams. Therefore, you cannot write out a window that has
> buttons. The original buttons in Morphic used action selectors instead of
> blocks. It shouldn't be hard to refactor Polymorph buttons to take the
> receiver, selector, and possible arguments instead of a block but I wonder
> whether its worth the trouble?
>

But in principle there's no reason why BlockCLosures and their associated
home contexts and methods can't be stored on a DataStream.  Is anyone brave
enough to try and eliminate the restriction?

best
Eliot


> Cheers,
> Adrian
>
>
> On Oct 15, 2010, at 02:22 , Sheridan Mahoney wrote:
>
> >
> > Hi all,
> > The method that generated the error in issue 3090 is below:
> >
> >
> > MethodContext(ContextPart)>>storeDataOn: aDataStream
> >
> >     "Contexts are not allowed go to out in DataStreams.  They must be
> included inside an ImageSegment."
> >
> >     aDataStream insideASegment ifTrue: [^ super storeDataOn:
> aDataStream].
> >
> >     self error: 'This Context was not included in the ImageSegment'.
> >         "or perhaps ImageSegments were not used at all"
> >     ^ nil
> >
> >
> > I've been trying to make sense of the stack, and it appears that writing
> a morph
> > to a file is hooking an object which cannot be written to a DataStream.
> >
> > Does anyone know whether the proper behavior is to:
> > - have the MethodContext go out without being inside an ImageSegment, or
> > - fix the morph-writing so that it uses ImageSegments???   Mariano would
> love
> > this, right?   :)
> >
> > Or perhaps there's a better way to understand the stack.
> >
> > Many thanks,
> > and Cheers,
> >
> > Sheri/dan
> >
> >
> > *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*
> > Listening's Auspicious Fortune is a heart
> > Rejuvenated with Profound Instructions.
> >
> > Reflection's Auspicious Fortune is the collapse
> > Of delusion's false cavern.
> >
> >      Kabje Kalu Rinpoche
> >
> > "With a pure motivation that does not wane and
> > with great courage that does not despair, may
> > each of us endeavour to make our lives meaningful "
> >
> >      H.H. the 17th Karmapa
> >      Orgyen Trinley Dorje
> >
> >
> >
> >
> > On Oct 11, 2010, at 7:16 AM, Sheridan Mahoney wrote:
> >
> >> I've just re-entered the Pharo world after a long(ish) absence, and
> wanted to report a
> >> new bug submission; here's  the breakdown:
> >>
> >> Pharo image:  dev
> >> Pharo core version: Pharo-1.1.1-- Latest update: #11414
> >> Virtual machine used: 4.0.3.2202 Unix VM
> >> OS: Ubuntu Lucid Lynx 10.04
> >> Class browser used if applicable: SystemBrowser default
> >>
> >> Steps to reproduce:
> >> 1.  start pharo
> >> 2.  open a Shout workspace
> >> 3.  select the just-opened workspace
> >> 4.  Ctrl-right button to get the meta-click window
> >> 5.  select 'save morph in file'
> >> 6.  hit 'ok' to proffered name for file
> >> 7.  a message box comes up that reads 'please wait while objects are
> >>    counted'.
> >> 8.  shortly after that an error is generated:
> >>    'Error: this context was not included in the ImageSegment'
> >>
> >>
> >> I'm planning on doing more research, but wanted to get the issue
> reported.
> >>
> >> Cheers,
> >> Sheridan
> >>
> >> PS - so far I really like 1.1.1 !!!  Good work, gang!
> >>
> >> _______________________________________________
> >> Pharo-project mailing list
> >> Pharo-project at lists.gforge.inria.fr
> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
> >
> >
> >
> > _______________________________________________
> > Pharo-project mailing list
> > Pharo-project at lists.gforge.inria.fr
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20101029/3a5a836e/attachment-0001.html>


More information about the Pharo-dev mailing list