You are browsing as a guest. Sign up (or log in) to start making projects!

Open comments for this post

54m 55s logged

Adding the People Viewer

The purpose of this session was to add a way to view the people currently in the Space/DM.

Part 1: Person Storage

Up to this point, there was no way to actually store the created people. To fix this, I created a Person class, a simple object to store the name and email. I then added a list to the Archive class to store the people.

Part 2: Dynamically Adding Widgets

I am using a more complicated system than with User Creation to dynamically switch what you can edit; I am hoping that this will give me more control, and hopefully make it easier to make the UI look good. The new method is to dynamically add a container with the right widgets inside when a button is pressed. To this end, I created a class based on the VerticalScrollBar to control the person editing. I didn’t fully understand how to dynamically add widgets at first; my first idea was to have a instance variable containing a container that would be yielded in the compose method; I could then update the variable to update the UI. As it turns out, this is not how texual works; I did try a bunch of methods to refresh the screen, but then I learned that you can call a mount method to add new widgets dynamically.

Part 3: The DataTable

The final step to getting this to work was to add a DataTable. I originally tried to generate the table in the compose method, but I switched to generating it upon creation of the container, as that appears to be the intended way to do it. I am a bit disappointed that the data table is rendered far to the right; Another UI detail for later (actually for later this time) I guess.

0
1

Comments 0

No comments yet. Be the first!