Any ideas? :)

Doru


Begin forwarded message:

From: Tudor Girba <tudor@tudorgirba.com>
Subject: completion appears in the wrong place
Date: 2 October 2011 18:16:41 CEST
To: Pharo Development <pharo-project@lists.gforge.inria.fr>

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


--
www.tudorgirba.com

"Speaking louder won't make the point worthier."




"What is more important: To be happy, or to make happy?"