Skip to content

Commit

Permalink
[002_private_public_attributes], issue #2, Ended changes of tabContro…
Browse files Browse the repository at this point in the history
…l into a private attribute and handled its deletion accordingly
  • Loading branch information
lelaus committed Oct 11, 2024
1 parent 3a7e5d4 commit 4e94ca0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tugui/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,14 @@ def __build_tabs_area(self) -> None:
support.destroy_widget(self.__plotTabController)

# Instatiate a Notebook object holding all the tabs
self.tabControl = ttk.Notebook(self)
self.__tabController = ttk.Notebook(self)
# Position the notebook into the main window grid
self.tabControl.grid(column=0, row=1, sticky="nsew", columnspan=2)
self.__tabController.grid(column=0, row=1, sticky="nsew", columnspan=2)
# Build the content of each tab frame by instantiating the class TabContentBuilder
self.tuplot_tab = TuPlotTabContentBuilder(
self.tabControl, tab_name="TU Plot", state=tk.DISABLED, guiConfig=self.guiconfig)
self.__tabController, tab_name="TU Plot", state=tk.DISABLED, guiConfig=self.guiconfig)
self.tustat_tab = TuStatTabContentBuilder(
self.tabControl, tab_name="TU Stat", state=tk.DISABLED, guiConfig=self.guiconfig)
self.__tabController, tab_name="TU Stat", state=tk.DISABLED, guiConfig=self.guiconfig)

def retrieve_simulation_info(self) -> None:
"""
Expand All @@ -380,7 +380,7 @@ def retrieve_simulation_info(self) -> None:
if self.pli_entry.var.get() == "": return
# In case of plot display-only mode, generate the event for rebuilding the configuration
# and the plot areas
if hasattr(self, 'plotTabControl'):
if self.__plotTabController:
self.event_generate('<<Reload>>')
# In case a previous .pli file has already been opened, check if the path of the entry
# has changed.
Expand Down Expand Up @@ -466,7 +466,7 @@ def activate_tustat_area(self) -> None:
to be run when the button in the tab area is pressed.
"""
print("Activating the TuStat tab...")
self.tabControl.tab(self.tustat_tab, state=tk.NORMAL)
self.__tabController.tab(self.tustat_tab, state=tk.NORMAL)
# Activate the "Diagram Nr." field of the active tab
print("Setting Diagram Nr. field state for TuStat...")
self.tustat_tab.diagram.cbx.configure(state='readonly')
Expand All @@ -487,13 +487,13 @@ def activate_tuplot_area(self) -> None:
the function to be run when the button in the tab area is pressed.
"""
print("Activating the TuPlot tab...")
self.tabControl.tab(self.tuplot_tab, state=tk.NORMAL)
self.__tabController.tab(self.tuplot_tab, state=tk.NORMAL)

# Activate the group field of the active tabs
print("Setting Group field state for TuPlot...")
self.tuplot_tab.group.cbx.configure(state='readonly')
# Select the TuPlot tab in order to show its content
self.tabControl.select(self.tuplot_tab)
self.__tabController.select(self.tuplot_tab)

# Set the list of slice names for the TuPlot tab
self.tuplot_tab.set_slice_list(self.slice_settings)
Expand Down

0 comments on commit 4e94ca0

Please sign in to comment.