You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you checked closed issues?
yes,my code is the same as the stopwatch tutorial,but the only problem is I can't import the .tcss file in my app.py,
here's the code:
//app.py
class StopwatchApp(App):
CSS_PATH = "stopwatch.tcss"
BINDINGS = [
("d","toggle_dark","Toggle dark mode"),
("a", "add_stopwatch", "Add"),
("r", "remove_stopwatch", "Remove"),
]
def compose(self) -> ComposeResult:
yield Header()
yield Footer()
yield ScrollableContainer(Stopwatch(),Stopwatch(),Stopwatch(),id="timers")
def action_toggle_dark(self) -> None:
self.dark = not self.dark
def action_add_stopwatch(self) -> None:
"""An action to add a timer."""
new_stopwatch = Stopwatch()
self.query_one("#timers").mount(new_stopwatch)
new_stopwatch.scroll_visible()
def action_remove_stopwatch(self) -> None:
"""Called to remove a timer."""
timers = self.query("Stopwatch")
if timers:
timers.last().remove()
if __name__ == "__main__":
app = StopwatchApp()
app.run()
and the stopwatch.tcss file is in the same folder with the app.py
I don't know why it isn't working,and when I click the button nothing happend here
when I RUN the app,it shows:
thank you!
The text was updated successfully, but these errors were encountered:
You would get a StylesheetError: unable to read CSS file error if the CSS file failed to load, but it looks like your app is running in your screenshot? Or is there something I've misunderstood?
Have you checked closed issues?
yes,my code is the same as the stopwatch tutorial,but the only problem is I can't import the .tcss file in my app.py,
here's the code:
and the stopwatch.tcss file is in the same folder with the app.py
I don't know why it isn't working,and when I click the button nothing happend here
when I RUN the app,it shows:

thank you!
The text was updated successfully, but these errors were encountered: