Hi,
I would like to get my model for a PluggableTextMorph work with ECompletion/OCompletion. To this end, I basically looked around for examples, and found OBTextPanel and its subclasses. So, I basically copied the following methods in my model (GLMSmalltalkCodeModel in the Glamour repo) and things seemed work fine: completionController | controller | controller := self triggerEvent: #getCompletionController. controller ifNil: [controller := self initializeCompletionController]. ^controller initializeCompletionController | controller | controller := self createCompletionController. self when: #getCompletionController evaluate: (MessageSend receiver: controller selector: #yourself). ^ controller createCompletionController ^(ECPreferences useECompletionInsteadOfOCompletion ifFalse: [ OController ] ifTrue: [ ECController ]) model: self Now, the problem is that when the textmorph in which I am rendering this is in a GLMFinder using an implementation similar to the one of OB, and somehow the completion looks to be rendered in absolute coordinates, rather than relative to the window (see the attached screenshots). Any hints regarding what goes wrong? Cheers, Doru |
Any ideas? :)
Doru Begin forwarded message:
|
A PluggableTextMorph (and text morphs in general) using 0-based coordinates in their bounds.
But they are usually wrapped by scroll pane / transform morph which doing local/global coordinate transformation for submorphs, therefore a submorphs positions could be in non-global coordinate system.
Best regards, Igor Stasenko. |
On 10 October 2011 14:25, Igor Stasenko <[hidden email]> wrote:
> > > On 10 October 2011 09:54, Tudor Girba <[hidden email]> wrote: >> >> Any ideas? :) >> Doru > > Have one. > A PluggableTextMorph (and text morphs in general) using 0-based coordinates > in their bounds. > But they are usually wrapped by scroll pane / transform morph which doing > local/global coordinate transformation for submorphs, > therefore a submorphs positions could be in non-global coordinate system. > You can see #boundInWorld implementation and follow it, to see how to obtain global coordinates from local ones. > > -- > Best regards, > Igor Stasenko. > -- Best regards, Igor Stasenko. |
Free forum by Nabble | Edit this page |