Lisp HUG Maillist Archive

position of a non-visible window

Hi

is it possible set or get the size of a window (pane) that has not  
been displayed ?

It is, I make a window by evaluating

(setf mywindow (make-instance 'capi:interface :x 10 :y 20))
#<CAPI:INTERFACE NIL 200DFFF3>

now I want to set the position of mywindow to x=50 and y=50 and then  
when I execute

(display mywindow)

The window appears at position (50,50)

thanks for your help

Carlos Agon




Re: position of a non-visible window

It's turns out to be a tricky question, actually.

According to the inspector the display coordinates of an Interface are  
contained in a slot called HINT-TABLE with a value similar to '(:X 50 :Y  
50). It is possible to change the values in the inspector and it works but  
this slot seems to be unaccessible to any of the CLOS operators. For  
example (SLOT-VALUE SOME-INTERFACE 'HINT-TABLE) drops you into the  
debugger.

I would consider it be a bug in the implementation. While it is addressed  
you'll probably have to initialize the window only when you need to  
display it.



On Wed, 10 Oct 2007 19:41:32 +0100, Carlos Agon <Carlos.Agon@ircam.fr>  
wrote:

>
> Hi
>
> is it possible set or get the size of a window (pane) that has not been  
> displayed ?
>
> It is, I make a window by evaluating
>
> (setf mywindow (make-instance 'capi:interface :x 10 :y 20))
> #<CAPI:INTERFACE NIL 200DFFF3>
>
> now I want to set the position of mywindow to x=50 and y=50 and then  
> when I execute
>
> (display mywindow)
>
> The window appears at position (50,50)
>
> thanks for your help
>
> Carlos Agon
>
>
>



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


Re: position of a non-visible window

On Wed, 10 Oct 2007 20:27:15 +0100, "Yury Davidouski" <dcu-stuff@list.ru> wrote:

> It's turns out to be a tricky question, actually.
>
> According to the inspector the display coordinates of an Interface
> are contained in a slot called HINT-TABLE with a value similar to
> '(:X 50 :Y 50). It is possible to change the values in the inspector
> and it works but this slot seems to be unaccessible to any of the
> CLOS operators. For example (SLOT-VALUE SOME-INTERFACE 'HINT-TABLE)
> drops you into the debugger.

Are you sure you used the right package qualifiers?

  CL-USER 1 > (apropos "hint-table")
  CAPI::HINT-TABLE (defined)
  CAPI:SET-HINT-TABLE (defined)
  SETF::\"CAPI\"\ \"HINT-TABLE\" (defined)

  CL-USER 2 > (capi:contain (make-instance 'capi:title-pane :title "foo"))
  #<CAPI:TITLE-PANE "" 21C746D3>

  CL-USER 3 > (slot-value * 'capi::hint-table)
  (:VISIBLE-MAX-HEIGHT T :VISIBLE-MAX-WIDTH T :VISIBLE-MIN-WIDTH :TEXT-WIDTH)

> I would consider it be a bug in the implementation.

Hmm...

Edi.


RE: position of a non-visible window

> is it possible set or get the size of a window (pane) that 
> has not been displayed ?
> 
> It is, I make a window by evaluating
> 
> (setf mywindow (make-instance 'capi:interface :x 10 :y 20)) 
> #<CAPI:INTERFACE NIL 200DFFF3>
> 
> now I want to set the position of mywindow to x=50 and y=50 
> and then when I execute

(capi:set-hint-table mywindow '(:x 50 :y 50))

Mitch


Re: position of a non-visible window

On Wed, 10 Oct 2007 20:52:12 +0100, "Yury Davidouski" <dcu-stuff@list.ru> wrote:

> No, I actually wasn't using the package qualifier for the simple
> reason that the symbol was created in the :user package which worked
> fine with the (inspect) function. Guess it is not necessarily a bug
> but not an example of clever design either.

Which symbol was created in the USER package and by what operation?


Re: position of a non-visible window

You might be able to do this easily using the :create-callback  
initarg. At this point, the pane is instantiated but not yet displayed.

John


On Oct 10, 2007, at 2:41 PM, Carlos Agon wrote:

> is it possible set or get the size of a window (pane) that has not  
> been displayed ?
>
> It is, I make a window by evaluating
>
> (setf mywindow (make-instance 'capi:interface :x 10 :y 20))
> #<CAPI:INTERFACE NIL 200DFFF3>
>
> now I want to set the position of mywindow to x=50 and y=50 and  
> then when I execute
>
> (display mywindow)
>
> The window appears at position (50,50)
>
> thanks for your help



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


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