Skip to main content

Detecting frame resize events

2 replies [Last post]
dutchiedave
Offline
Joined: 2004-05-12
Points: 0

Hi all,

Could anybody tell me how to detect frame resize events?

I want to be able to keep my canvas filling up the frame after a resize.

Thanks.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
alexsch
Offline
Joined: 2007-07-12
Points: 0

You can use [b]binding[/b] for that

[code]
import javafx.gui.*;

var width = 200;
var height = 300;

Frame {
title: "MyApplication"
width: bind width with inverse
height: bind height with inverse

content: Canvas {
content: Line{
x1: 30
y1: 30
x2: bind width - 30
y2: bind height - 30
}
}

visible: true
}
[/code]

dutchiedave
Offline
Joined: 2004-05-12
Points: 0

Thank you,

That was exactly what i needed,

Dave.