From: Francis Leboutte

Subject: Re: Where's my Key-Down-Event?

Date: 2000-6-15 12:30

At 14/06/00 20:49 +0200, Busch, Ciske wrote:
>Hi,
Hello
>I need a control that looks like a static text but >allows it's text to be edited if the user >mouse-clicks into it. After he has either pressed >ENTER or TAB or after he has mouse-clicked somewhere >else the control should look like a static text again and >- most important - should not have keyboard focus anymore. > >(I tried to solve this by using a static text and opening >a temporary editable-text at the same position after the >user clicked into the static-text. Removing the editable-text >works fine when using mouse-clicks but not when pressing >enter or tab.)
Looks too twisted to be a good solution. I think you just should use an editable-text with the following arguments: (make-instance 'editable-text :background-color light-gray :border :none ... ) It will look like a static text (Instead of using light-gray it would be better to use the background-color and the default-background-color functions) Then you could define event handlers (on-click, on-kill-focus) to dynamically modify the background-color of the widget.
>Unfortunatly I do not know how to move the keyboard focus >away from that control after the user has finished editing.
You should not have to bother about focus here.
>I tried to use the VIRTUAL-KEY-DOWN method to achieve this >but neither the used dialog nor the editable-text receive >that event. > >Can anybody give me a hint on what I am doing wrong here?
You should not need anymore to do this. If interrested in, looks at the subclass-widget function and the on-line document about events. -- Francis Leboutte Algorithme, Rue de la Charrette 141, 4130 Tilff, Belgium <algo.be at fl> <acm.org at leboutte> www.algo.be +32-(0)4.388.3919