Project

General

Profile

popup positioning

Added by Michael Buro over 10 years ago

I am trying to display a button on top of a WPaintedWidget as a popup in jwt.

The documentation mentions setPopup and PositionScheme.Absolute

but there is no code example.

My code looks like this:

WVBoxLayout layout = new WVBoxLayout();

app.getRoot().setLayout(layout);

layout.addWidget(new GameWidget());

WPushButton button = new WPushButton("hello");

button.setPositionScheme(PositionScheme.Absolute);

button.setPopup(true);

layout.addWidget(button);

This creates a button in the lower half of the window.

I also tried app.getRoot().addWidget(button); - thinking that

maybe popup widgets can't be part of the layout. But this shows no

button at all.

I couldn't find a way to set the button location relative to parent, either.

Thanks for any help on this.