pharo-users@lists.pharo.org

Any question about pharo is welcome

View all threads

How to get dimensions (extent) of a SpPresenter

K
kmo
Tue, May 25, 2021 11:59 AM

Here are details of X11, the Image and the VM

X11

xdpyinfo | grep version
version number:    11.0
X.Org version: 1.20.9

Image

/home/kmp/Pharo/images/gtkRoses/gtkRoses.image
Pharo9.0.0
Build information:
Pharo-9.0.0+build.1399.sha.9ae8329dedfbad7915b7b2cdc4accc7ce8109ce0 (64 Bit)
Unnamed

Virtual Machine

/home/kmp/Pharo/vms/90-x64-headless/lib/pharo
CoInterpreter VMMaker-tonel.1 uuid: 286e9806-8e7d-0d00-ab06-4e280faf8631 Apr
30 2021
StackToRegisterMappingCogit VMMaker-tonel.1 uuid:
286e9806-8e7d-0d00-ab06-4e280faf8631 Apr 30 2021
5125110 - Commit: 5125110 - Date: 2021-04-30 10:05:04 +0200

Pharo 9.0.0 built on Apr 30 2021 10:22:47 Compiler: 5.4.0 20160609
VMMaker versionString 5125110 - Commit: 5125110 - Date: 2021-04-30 10:05:04
+0200
CoInterpreter VMMaker-tonel.1 uuid: 286e9806-8e7d-0d00-ab06-4e280faf8631 Apr
30 2021
StackToRegisterMappingCogit VMMaker-tonel.1 uuid:
286e9806-8e7d-0d00-ab06-4e280faf8631 Apr 30 2021

--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Here are details of X11, the Image and the VM X11 ------- xdpyinfo | grep version version number: 11.0 X.Org version: 1.20.9 Image ----- /home/kmp/Pharo/images/gtkRoses/gtkRoses.image Pharo9.0.0 Build information: Pharo-9.0.0+build.1399.sha.9ae8329dedfbad7915b7b2cdc4accc7ce8109ce0 (64 Bit) Unnamed Virtual Machine --------------- /home/kmp/Pharo/vms/90-x64-headless/lib/pharo CoInterpreter VMMaker-tonel.1 uuid: 286e9806-8e7d-0d00-ab06-4e280faf8631 Apr 30 2021 StackToRegisterMappingCogit VMMaker-tonel.1 uuid: 286e9806-8e7d-0d00-ab06-4e280faf8631 Apr 30 2021 5125110 - Commit: 5125110 - Date: 2021-04-30 10:05:04 +0200 Pharo 9.0.0 built on Apr 30 2021 10:22:47 Compiler: 5.4.0 20160609 VMMaker versionString 5125110 - Commit: 5125110 - Date: 2021-04-30 10:05:04 +0200 CoInterpreter VMMaker-tonel.1 uuid: 286e9806-8e7d-0d00-ab06-4e280faf8631 Apr 30 2021 StackToRegisterMappingCogit VMMaker-tonel.1 uuid: 286e9806-8e7d-0d00-ab06-4e280faf8631 Apr 30 2021 -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
EL
Esteban Lorenzano
Thu, May 27, 2021 9:29 AM

Hi,

So, I was able to reproduce your problem : for some reason, cairo does not answer a correct surface extent while in x11 (I didn't noticed before because I use wayland).
I can hack a solution (and I will), but have fear that will cause future problems :/
Anyway, I will commit a fix and you will be able to use the surface extent message.

Esteban
On May 25 2021, at 1:59 pm, kmo voxkmp@gmail.com wrote:

Here are details of X11, the Image and the VM

X11

xdpyinfo | grep version
version number: 11.0
X.Org version: 1.20.9

Image

/home/kmp/Pharo/images/gtkRoses/gtkRoses.image
Pharo9.0.0
Build information:
Pharo-9.0.0+build.1399.sha.9ae8329dedfbad7915b7b2cdc4accc7ce8109ce0 (64 Bit)
Unnamed

Virtual Machine

/home/kmp/Pharo/vms/90-x64-headless/lib/pharo
CoInterpreter VMMaker-tonel.1 uuid: 286e9806-8e7d-0d00-ab06-4e280faf8631 Apr
30 2021
StackToRegisterMappingCogit VMMaker-tonel.1 uuid:
286e9806-8e7d-0d00-ab06-4e280faf8631 Apr 30 2021
5125110 - Commit: 5125110 - Date: 2021-04-30 10:05:04 +0200

Pharo 9.0.0 built on Apr 30 2021 10:22:47 Compiler: 5.4.0 20160609
VMMaker versionString 5125110 - Commit: 5125110 - Date: 2021-04-30 10:05:04
+0200
CoInterpreter VMMaker-tonel.1 uuid: 286e9806-8e7d-0d00-ab06-4e280faf8631 Apr
30 2021
StackToRegisterMappingCogit VMMaker-tonel.1 uuid:
286e9806-8e7d-0d00-ab06-4e280faf8631 Apr 30 2021

--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Hi, So, I was able to reproduce your problem : for some reason, cairo does not answer a correct surface extent while in x11 (I didn't noticed before because I use wayland). I can hack a solution (and I will), but have fear that will cause future problems :/ Anyway, I will commit a fix and you will be able to use the surface extent message. Esteban On May 25 2021, at 1:59 pm, kmo <voxkmp@gmail.com> wrote: > Here are details of X11, the Image and the VM > > X11 > ------- > > xdpyinfo | grep version > version number: 11.0 > X.Org version: 1.20.9 > > > Image > ----- > /home/kmp/Pharo/images/gtkRoses/gtkRoses.image > Pharo9.0.0 > Build information: > Pharo-9.0.0+build.1399.sha.9ae8329dedfbad7915b7b2cdc4accc7ce8109ce0 (64 Bit) > Unnamed > > Virtual Machine > --------------- > /home/kmp/Pharo/vms/90-x64-headless/lib/pharo > CoInterpreter VMMaker-tonel.1 uuid: 286e9806-8e7d-0d00-ab06-4e280faf8631 Apr > 30 2021 > StackToRegisterMappingCogit VMMaker-tonel.1 uuid: > 286e9806-8e7d-0d00-ab06-4e280faf8631 Apr 30 2021 > 5125110 - Commit: 5125110 - Date: 2021-04-30 10:05:04 +0200 > > Pharo 9.0.0 built on Apr 30 2021 10:22:47 Compiler: 5.4.0 20160609 > VMMaker versionString 5125110 - Commit: 5125110 - Date: 2021-04-30 10:05:04 > +0200 > CoInterpreter VMMaker-tonel.1 uuid: 286e9806-8e7d-0d00-ab06-4e280faf8631 Apr > 30 2021 > StackToRegisterMappingCogit VMMaker-tonel.1 uuid: > 286e9806-8e7d-0d00-ab06-4e280faf8631 Apr 30 2021 > > > > > > -- > Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html >
K
kmo
Thu, May 27, 2021 11:16 AM
Many thanks Estaban -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
K
kmo
Wed, Jun 16, 2021 12:20 PM

Hi Esteban

Do you know when the fix for the extent problem under Gtk will be in the
image? I downloaded the latest Pharo 9 image a couple of days ago and,
though the fix was in for the extent problem in Morphic, it still didn't
work in Gtk.

Thanks.

Ken

--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Hi Esteban Do you know when the fix for the extent problem under Gtk will be in the image? I downloaded the latest Pharo 9 image a couple of days ago and, though the fix was in for the extent problem in Morphic, it still didn't work in Gtk. Thanks. Ken -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
EL
Esteban Lorenzano
Wed, Jun 16, 2021 12:27 PM

Hi,
Yes, it is there.
Thing is... since cairo does not informs correctly extent of surface in x11, what I did is to add an extra parameter to the drawing block, as you can see in the example :

SpAthensPresenter>>#exampleResizing
| extent |
extent := 350@300.
self new
surfaceExtent: extent;
drawBlock: [ :aCanvas :boundingBox | | paint surface |
"Since sometimes a cairo surface does not brings the correct extent (in X11 or Windows,
for example), we use the bounding box of the component."
surface := aCanvas surface.
paint := surface
createLinearGradient: {
0->Color red.
1->Color green }
start: 0@0
stop: boundingBox extent.
surface clear.
aCanvas setPaint: paint.
aCanvas drawShape: (0@0 extent: boundingBox extent) ];
openWithSpec

That was tested on Wayland and x11 and it was working properly :)
Esteban

On Jun 16 2021, at 2:20 pm, kmo voxkmp@gmail.com wrote:

Hi Esteban

Do you know when the fix for the extent problem under Gtk will be in the
image? I downloaded the latest Pharo 9 image a couple of days ago and,
though the fix was in for the extent problem in Morphic, it still didn't
work in Gtk.

Thanks.
Ken

--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Hi, Yes, it is there. Thing is... since cairo does not informs correctly extent of surface in x11, what I did is to add an extra parameter to the drawing block, as you can see in the example : SpAthensPresenter>>#exampleResizing | extent | extent := 350@300. self new surfaceExtent: extent; drawBlock: [ :aCanvas :boundingBox | | paint surface | "Since sometimes a cairo surface does not brings the correct extent (in X11 or Windows, for example), we use the bounding box of the component." surface := aCanvas surface. paint := surface createLinearGradient: { 0->Color red. 1->Color green } start: 0@0 stop: boundingBox extent. surface clear. aCanvas setPaint: paint. aCanvas drawShape: (0@0 extent: boundingBox extent) ]; openWithSpec That was tested on Wayland and x11 and it was working properly :) Esteban On Jun 16 2021, at 2:20 pm, kmo <voxkmp@gmail.com> wrote: > Hi Esteban > > Do you know when the fix for the extent problem under Gtk will be in the > image? I downloaded the latest Pharo 9 image a couple of days ago and, > though the fix was in for the extent problem in Morphic, it still didn't > work in Gtk. > > Thanks. > Ken > > > > -- > Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html >
EL
Esteban Lorenzano
Wed, Jun 16, 2021 12:29 PM

boo... format lost :P

On Jun 16 2021, at 2:27 pm, Esteban Lorenzano estebanlm@netc.eu wrote:

Hi,
Yes, it is there.
Thing is... since cairo does not informs correctly extent of surface in x11, what I did is to add an extra parameter to the drawing block, as you can see in the example :

SpAthensPresenter>>#exampleResizing
| extent |
extent := 350@300.
self new
surfaceExtent: extent;
drawBlock: [ :aCanvas :boundingBox | | paint surface |
"Since sometimes a cairo surface does not brings the correct extent (in X11 or Windows,
for example), we use the bounding box of the component."
surface := aCanvas surface.
paint := surface
createLinearGradient: {
0->Color red.
1->Color green }
start: 0@0
stop: boundingBox extent.
surface clear.
aCanvas setPaint: paint.
aCanvas drawShape: (0@0 extent: boundingBox extent) ];
openWithSpec

That was tested on Wayland and x11 and it was working properly :)
Esteban

On Jun 16 2021, at 2:20 pm, kmo voxkmp@gmail.com wrote:

Hi Esteban

Do you know when the fix for the extent problem under Gtk will be in the
image? I downloaded the latest Pharo 9 image a couple of days ago and,
though the fix was in for the extent problem in Morphic, it still didn't
work in Gtk.

Thanks.
Ken

--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

boo... format lost :P On Jun 16 2021, at 2:27 pm, Esteban Lorenzano <estebanlm@netc.eu> wrote: > > Hi, > Yes, it is there. > Thing is... since cairo does not informs correctly extent of surface in x11, what I did is to add an extra parameter to the drawing block, as you can see in the example : > > SpAthensPresenter>>#exampleResizing > | extent | > extent := 350@300. > self new > surfaceExtent: extent; > drawBlock: [ :aCanvas :boundingBox | | paint surface | > "Since sometimes a cairo surface does not brings the correct extent (in X11 or Windows, > for example), we use the bounding box of the component." > surface := aCanvas surface. > paint := surface > createLinearGradient: { > 0->Color red. > 1->Color green } > start: 0@0 > stop: boundingBox extent. > surface clear. > aCanvas setPaint: paint. > aCanvas drawShape: (0@0 extent: boundingBox extent) ]; > openWithSpec > > That was tested on Wayland and x11 and it was working properly :) > Esteban > > On Jun 16 2021, at 2:20 pm, kmo <voxkmp@gmail.com> wrote: > > Hi Esteban > > > > Do you know when the fix for the extent problem under Gtk will be in the > > image? I downloaded the latest Pharo 9 image a couple of days ago and, > > though the fix was in for the extent problem in Morphic, it still didn't > > work in Gtk. > > > > Thanks. > > Ken > > > > > > > > -- > > Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html > > >
K
kmo
Wed, Jun 16, 2021 1:52 PM

Many thanks esteban - works fine now in Gtk

--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Many thanks esteban - works fine now in Gtk -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html