#19 TField fixes
[fanfix.git] / src / jexer / demos / DemoTreeViewWindow.java
index ad588a916acdca4f8957287fac54d24ba3df3381..7697981c015bb8b0db59874b0091ee3697ba8332 100644 (file)
@@ -3,7 +3,7 @@
  *
  * The MIT License (MIT)
  *
- * Copyright (C) 2016 Kevin Lamonte
+ * Copyright (C) 2017 Kevin Lamonte
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -73,10 +73,10 @@ public class DemoTreeViewWindow extends TWindow {
     @Override
     public void onResize(final TResizeEvent resize) {
         if (resize.getType() == TResizeEvent.Type.WIDGET) {
-            // Resize the text field
-            treeView.setWidth(resize.getWidth() - 4);
-            treeView.setHeight(resize.getHeight() - 4);
-            treeView.reflow();
+            // Resize the treeView field
+            TResizeEvent treeSize = new TResizeEvent(TResizeEvent.Type.WIDGET,
+                resize.getWidth() - 4, resize.getHeight() - 4);
+            treeView.onResize(treeSize);
             return;
         }