On Thu, Jan 31, 2013 at 10:09 PM, Stéphane Ducasse < stephane.duca...@inria.fr> wrote:
> Usman > > I also try just returning the container but do not know the expected > result. > It "works" > It kinda "works" because DNU has disappeared. Scenario I have a list, when I select an element from the list, its properties, visu and metrics are shown by glamour. Ideal Situation: I trigger the selection of a random node (from another visu) and its not part of the shown elements in the list (but is still part of model), it should be selected/gets focus in the list. what this "Fix" does With the "fix", I can see the properties and visu of the selected node in my browser and DNU is gone. But selection of the node does not happen. For me, sufficient to show a problem-free UI but its not the ideal behavior. Should this "fix" be a part of pharo? But this code needs a thorough inspection. usman > > > Stef > > > > On Jan 31, 2013, at 12:48 PM, Usman Bhatti wrote: > > > > > > > > > On Thu, Jan 31, 2013 at 1:20 PM, Stéphane Ducasse < > stephane.duca...@inria.fr> wrote: > > Usman did you check with 1.3 to know if the method was there? > > > > I looked in 1.3. The method is defined on MorphTreeMorph (see sceenshot) > but absent from this class in 1.4. Copying and pasting the method from 1.3 > to 1.4 in the class does not work, there are some missing instance > variables in the code. > > The number of implementing classes for setSelectedMorph: does not change > between 1.3 and 1.4. To me it seems that the method was moved to > MorphTreeListManager in 1.4. It tried to change the receiver to invoke the > method on MorphTreeListManager but there are some other problems then. > > > > <image.png> > > > > > > Stef > > > > On Jan 31, 2013, at 7:03 AM, Usman Bhatti wrote: > > > > > > > > > > > > > > On Thu, Jan 31, 2013 at 2:30 AM, Stéphane Ducasse < > stephane.duca...@inria.fr> wrote: > > > Morbid fascination > > > It is late so I may completely off but > > > how many isKindOf: are executed in this method? > > > > > > > ((aSymbol isKindOf: Array) > > > > and: [aSymbol size > 1 and: [aSymbol first == self > nodeListSelector and: [ > > > > aSymbol second == #openPath]]]) > > > > > > when [aSymbol second == #openPath] is not openPath > > > then we go to the next (not mentioning duplicated code inside the > method ---- I will vomit) > > > and we restart to execute isKindOf: > > > > > > ((aSymbol isKindOf: Array) > > > and: [aSymbol size > 1 and: [aSymbol first == self > nodeListSelector and: [ > > > aSymbol second == > #expandAllFromNode:]]]) > > > > > > Am'I right? > > > It looks so terrible. > > > > > > Yes. And more so for someone not frequently working with Morphs. > > > So, can someone at least see if the problem can be fixed without a > large refactoring that should surely happen, but the glamour bug needs a > quick fix. Or at least point to why the missing method on the receiver is > abundantly found in the code? > > > > > > usman > > > > > > > > > Stef > > > > > > > > > > > > > update: aSymbol > > > > aSymbol == #selection ifTrue: [^ self listManager > updateSelectionFromModel]. > > > > ((aSymbol isKindOf: Array) and: [aSymbol size > 1 and: > [aSymbol first == #selectItems and: [aSymbol second isCollection]]]) > > > > ifTrue: [^ self selectedItems: aSymbol second]. > > > > aSymbol == self nodeListSelector ifTrue: [^ self updateList]. > > > > aSymbol == #selectAll ifTrue: [^ self listManager selectAll]. > > > > aSymbol == #deselectAll ifTrue: [^ self listManager > deselectAll]. > > > > ((aSymbol isKindOf: Array) > > > > and: [aSymbol size > 1 and: [aSymbol first == self > nodeListSelector and: [ > > > > aSymbol second == > #openPath]]]) "allow directed path opening where multiple trees exist" > > > > ifTrue: > > > > [^(self allNodeMorphs at: 1 ifAbsent: > [^self]) > > > > openPath: (aSymbol > allButFirst: 2)]. > > > > ((aSymbol isKindOf: Array) > > > > and: [aSymbol size > 1 and: [aSymbol first == self > nodeListSelector and: [ > > > > aSymbol second == > #openItemPath]]]) "allow directed path opening where multiple trees exist" > > > > ifTrue: > > > > [^ (self allNodeMorphs at: 1 ifAbsent: > [^self]) > > > > openItemPath: (aSymbol > allButFirst: 2)]. > > > > ((aSymbol isKindOf: Array) > > > > and: [aSymbol size > 1 and: [aSymbol first == self > nodeListSelector and: [ > > > > aSymbol second == > #expandAllFromNode:]]]) > > > > ifTrue: > > > > [^ self expandAllFromNode: aSymbol > third]. > > > > ((aSymbol isKindOf: Array) > > > > and: [aSymbol size > 1 and: [aSymbol first == self > nodeListSelector and: [ > > > > aSymbol second == > #closeItemPath]]]) "allow directed path closing where multiple trees exist" > > > > ifTrue: > > > > [^ (self allNodeMorphs at: 1 ifAbsent: > [^self]) > > > > closeItemPath: (aSymbol > allButFirst: 2)]. > > > > ((aSymbol isKindOf: Array) > > > > and: [aSymbol notEmpty and: [aSymbol first == > #openPath]]) > > > > ifTrue: > > > > [^(self allNodeMorphs at: 1 ifAbsent: > [^self]) > > > > openPath: aSymbol allButFirst]. > > > > ((aSymbol isKindOf: Array) > > > > and: [aSymbol size = 2 and: [aSymbol first = self > nodeListSelector and: [ > > > > aSymbol second == > #expandRoots]]]) > > > > ifTrue: > > > > [^self expandRoots]. > > > > ((aSymbol isKindOf: Array) > > > > and: [aSymbol size = 2 and: [aSymbol first = self > nodeListSelector]]) > > > > ifTrue: [aSymbol second = #expandAll ifTrue: [^ self > expandAll]. > > > > aSymbol second = #collapseAll ifTrue: [^ self > collapseAll]] > > > > > > > > > > > > > > > > > >