Skip to content

Commit

Permalink
improves last commit's removal of the SettingsPanel's title by using …
Browse files Browse the repository at this point in the history
…the `InterfaceWithNoMenu`'s `current_panel` instance field and looping through that panel's children to remove the Label.

See also:

 * #16 (comment)
  • Loading branch information
maltfield committed Nov 16, 2022
1 parent 5d81708 commit 91b68a8
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions src/buskill_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,10 +564,17 @@ def on_pre_enter(self, *args):
print( "dir(s):|" +str(dir(s))+ "|\n" )

print( "s.interface:|" +str(s.interface)+ "|" )
print( "s.interface.panels:|" +str(s.interface.panels)+ "|" )
print( "s.interface.current_panel:|" +str(s.interface.current_panel)+ "|" )
print( "s.interface.children:|" +str(s.interface.children)+ "|" )
print( "s.interface.walk():|" +str([widget for widget in s.interface.walk()])+ "|" )
print( "dir(s.interface):|" +str(dir(s.interface))+ "|\n" )

print( "s.interface.current_panel:|" +str(s.interface.current_panel)+ "|" )
print( "s.interface.current_panel.children:|" +str(s.interface.current_panel.children)+ "|" )
print( "s.interface.current_panel.walk():|" +str([widget for widget in s.interface.current_panel.walk()])+ "|" )
print( "dir(s.interface.current_panel):|" +str(dir(s.interface.current_panel))+ "|\n" )

print( "s.interface_cls:|" +str(s.interface_cls)+ "|" )
print( "s.interface_cls.children:|" +str(s.interface_cls.children)+ "|" )
print( "dir(s.interface_cls):|" +str(dir(s.interface_cls))+ "|\n" )
Expand All @@ -582,10 +589,31 @@ def on_pre_enter(self, *args):
# if type(child) == BoxLayout:
# s.remove_widget(child)

#print( "s.child:|" +str(s.children[0].children[0].children[0].children[0].children)+ "|" )
print( str( type(s) ) )
print( str( s.children ) )
print( str( s.children[0].children ) )
print( str( s.children[0].children[0].children ) )
print( str( s.children[0].children[0].children[0].children ) )
print( "SettingOptions: " +str( s.children[0].children[0].children[0].children[0].children ) )
print( "\t" + str( s.children[0].children[0].children[0].children[0].children[0].children ) )
print( "\tBoxLayout: " + str( s.children[0].children[0].children[0].children[0].children[0].children[0].children ) )
print( "\t\t" + str( s.children[0].children[0].children[0].children[0].children[0].children[0].children[0].children ) )
print( "\tLabel: " + str( s.children[0].children[0].children[0].children[0].children[0].children[1].children ) )
print( "Label: " +str( s.children[0].children[0].children[0].children[1].children ) )
#print( str( s.children[0].children[0].children[0] ) )
#print( str( s.children[0].children[0].children[0].children[0] ) )
#print( str( s.children[0].children[0].children[0].children[1] ) )
#print( str( s.children[0].children[0].children[0].children[1] ) )
print( "\n***\n" )
# s.children[0].children[0].children[0].remove_widget( s.children[0].children[0].children[0].children[1] )
print( "s.child:|" +str(s.children[0].children[0].children[0].children[0].children)+ "|" )
s.children[0].children[0].children[0].remove_widget( s.children[0].children[0].children[0].children[1] )
print( "s.child:|" +str(s.children[0].children[0].children[0].children[0].children)+ "|" )

#s.remove_widget( s.children[0].children[1] )
#s.interface.current_panel.title = None
for child in s.interface.current_panel.children:
if type(child) == Label:
s.interface.current_panel.remove_widget(child)

self.settings_content.add_widget( s )

Expand Down

0 comments on commit 91b68a8

Please sign in to comment.