Spec icon indicating copy to clipboard operation
Spec copied to clipboard

Changing window extent seems broken in P12 and P13

Open ClotildeToullec opened this issue 1 year ago • 6 comments

To reproduce:

presenter := SpPresenter new.
presenter layout: (SpBoxLayout newVertical).
presenter open.
presenter window extent. "This returns nil".
presenter window window extent. "This returns [email protected]"

presenter withWindowDo: [ :window | window extent: 100 @ 100 ]. "This does nothing"
presenter withWindowDo: [ :window | window window extent: 100 @ 100 ]. "This works"

ClotildeToullec avatar Aug 30 '24 08:08 ClotildeToullec

@estebanlm can you have a look because this can impact the book? @koendehondt

Ducasse avatar Aug 30 '24 12:08 Ducasse

I will, give me a couple of days, I am still in "back from holidays" mode :) there are some misconceptions there and at least one issue may be a bug... but I need to look at it :)

estebanlm avatar Aug 30 '24 15:08 estebanlm

So, some answers.

  1. You should never use window window, this is the backend window and you should not be going against demeters law or you will lose portability and you may cause sync problems between spec and the backend (nnot saying this will be the case here, but it could happen).
  2. extent and extent: are in the TOREMOVE protocol on SpPresenter, so... you should not use it ;)
  3. The correct protocols are:
  • initialExtent: to declare the original size of the window before it is opened.
  • resize: to change the size after it is opened.

What I do believe is a bug (or a missing feature) is that there is no vocabulary to query current window size, I will add it :)

estebanlm avatar Sep 03 '24 10:09 estebanlm

done (not integrated into P13 yet).

estebanlm avatar Sep 03 '24 11:09 estebanlm

Ah, thanks. We tried window window while debugging; of course we don't keep that. The use of #extent:is legacy, thank you for pointing #resize:, I will make the change in Moose.

ClotildeToullec avatar Sep 03 '24 12:09 ClotildeToullec

@Ducasse

@estebanlm can you have a look because this can impact the book? @koendehondt

In the book, in chapter "9 Managing windows", there is a section "9.5 Window size and decoration" with a subsection "Setting initial size and changing size" that describes what @estebanlm wrote about the correct protocols.

koendehondt avatar Sep 03 '24 19:09 koendehondt