import jexer.TScrollableWindow;
import jexer.TVScroller;
import jexer.TWidget;
+import jexer.event.TResizeEvent;
public class TSimpleScrollableWindow extends TScrollableWindow {
protected TPanel mainPane;
int width, int height, int flags, int realWidth, int realHeight) {
super(application, title, width, height, flags);
- mainPane = new TPanel(this, 0, 0, width, 80) {
+ mainPane = new TPanel(this, 0, 0, 1, 1) {
@Override
public void draw() {
for (TWidget children : mainPane.getChildren()) {
}
};
- // // TODO: test
- // for (int i = 0; i < 80; i++) {
- // mainPane.addLabel("ligne " + i, i, i);
- // }
+ mainPane.setWidth(getWidth());
+ mainPane.setHeight(getHeight());
setRealWidth(realWidth);
setRealHeight(realHeight);
reflowData();
}
+ @Override
+ public void onResize(TResizeEvent event) {
+ super.onResize(event);
+ mainPane.setWidth(getWidth());
+ mainPane.setHeight(getHeight());
+ mainPane.onResize(event);
+ }
+
@Override
public void reflowData() {
super.reflowData();