contrib/tnitter: use the new `clear` for a cleaner behavior
authorAlexis Laferrière <alexis.laf@xymus.net>
Thu, 7 Apr 2016 17:45:22 +0000 (13:45 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Thu, 7 Apr 2016 17:58:34 +0000 (13:58 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/tnitter/src/tnitter_app.nit

index b8a955a..fccad93 100644 (file)
@@ -73,8 +73,7 @@ class TnitterWindow
        # Update the screen to show the new `posts`
        fun apply_update(posts: Array[Post])
        do
-               layout.remove list_posts
-               list_posts = new ListLayout(parent=layout)
+               list_posts.clear
                for post in posts do
                        var line = new VerticalLayout(parent=list_posts)
                        var author = new LabelAuthor(parent=line, text="@"+post.user)