Closed GideonWolfe closed 4 years ago
Figured it out.
contentGrid = &courseMasterGrids[tabpane.ActiveTabIndex-1] // Select the correct grid to edit
contentGrid.Items[1].Entry = &courseOverviewGrids[tabpane.ActiveTabIndex-1] // Change item in subgrid based on user choice
masterGrid.Items[1].Entry = contentGrid // update subgrid
I have a program where I want the user to use a tab bar to select between multiple pages.
I am new to go and this framework so I am pretty sure I'm doing something wrong.
Currently my setup is I have a "master grid", which only contains the top navigation tab bar, and another row to contain another grid, which the user will interact with.
What this grid will be should be a result of the users navbar selection.
My overall confusion is with the "rendering" of these grids and buffers, and how to do it optimally and correctly.
Currently, I declare the main objects like so, using my
createDashboardGrid()
function to return aui.Grid
object with some placeholder widgets, as well ascreateMainTabPane()
to return a tabpane with a generated list of selections.Then I use a function
updateMasterGrid()
which sets the properties (rows, columns, etc) of the master grid. The idea is thatupdateMasterGrid()
assigns the gridcontentGrid()
to the second row slot inmasterGrid()
.Then I use the eventhandler loop to wait for input. If the user presses
Enter
, I want thecontentGrid
variable to be changed to reflect the users choice. Then I try to callupdateMasterGrid()
to try and load the newcontentGrid
intomasterGrid
.Am I going about this in the wrong way? Currently the rendered grids are getting layered and the more I press
Enter
, the slower it gets. I must be missing the proper way to EDIT a grid, and I'm just creating new ones?