Lisp HUG Maillist Archive

Errorneous CAPI hints :external-max-width (:character n) and (:string n)?

Hi,

if I use :external-max-width (:character 5) on a text-input-pane I get no
correct result (I can enter _2_ characters). The input-pane is not wide
enough to accept 5 characters. Using (:string "XXXXX") I am able to enter
_4_ visible characters, thus this unit seems also to be wrong.

What am I missing?

Any helpful hint appreciated.

Andreas


AW: Errorneous CAPI hints :external-max-width (:character n) and (:string n)?

 

> -----Ursprüngliche Nachricht-----
> Von: owner-lisp-hug@lispworks.com 
> [mailto:owner-lisp-hug@lispworks.com] Im Auftrag von Andreas Thiele
> Gesendet: Dienstag, 9. Januar 2007 11:04
> An: lisp-hug@lispworks.com
> Betreff: Errorneous CAPI hints :external-max-width 
> (:character n) and (:string n)?
> 
> 
> Hi,
> 
> if I use :external-max-width (:character 5) on a 
> text-input-pane I get no correct result (I can enter _2_ 
> characters). The input-pane is not wide enough to accept 5 
> characters. Using (:string "XXXXX") I am able to enter _4_ 
> visible characters, thus this unit seems also to be wrong.
> 
> What am I missing?
> 
> Any helpful hint appreciated.
> 
> Andreas
> 

I forgot to mention LWW 5.0.1

Andreas



RE: Errorneous CAPI hints :external-max-width (:character n) and (:string n)?

> if I use :external-max-width (:character 5) on a 
> text-input-pane I get no correct result (I can enter _2_ 
> characters). The input-pane is not wide enough to accept 5 
> characters. Using (:string "XXXXX") I am able to enter _4_ 
> visible characters, thus this unit seems also to be wrong.

I think there are two issues with what you are trying to do.  The default
font is proportional. So when I do (in LW 4.4.6):

(capi:contain (make-instance 'capi:text-input-pane
                             :external-max-width '(:character 5)))

the text pane will hold 7 "X"s before scrolling. It will also hold 25 "i"s.
So I don't know to what size proportional character the :character keyword
refers. 

I think the keyword :string is what you want but with :visible-xxx-xxx
instead of :external-xxx-xxx.  I think that :external-xxx-xxx specifies the
size of the pane in its parent and will include the borders of the child.
If you want to fit someting inside the pane, I think you should be using
:visible-xxx-xxx.  This example will hold the 5 "X"s exactly:

(capi:contain (make-instance 'capi:text-input-pane
                             :visible-min-width '(:string "XXXXX")
                             :visible-max-width t))

Naturally, I would be happy to hear from someone more knowledgeable.

Mitch 


AW: Errorneous CAPI hints :external-max-width (:character n) and (:string n)?

> (capi:contain (make-instance 'capi:text-input-pane
>                              :visible-min-width '(:string "XXXXX")
>                              :visible-max-width t))

Thanks a lot, works perfectly for me.

Andreas


Updated at: 2020-12-10 08:46 UTC