Distro: Pop-os (Debian/Ubuntu)
Workspace: VSCode
Hello,
I’m quite new to this so it might be a simple error.
This is the code where the error occurs:
class MainWindow(Gtk.ApplicationWindow, Settings):
def __init__(self, settings, *args, **kwargs):
super().__init__(*args, **kwargs)
print(settings)
# Window Layout
# self.set_default_size(1200, 500)
# Grid
self.grid = Gtk.Grid()
self.set_child(self.grid)
self.grid.set_column_homogeneous(True)
# Add the Hours
self.grid.attach(Gtk.Label(label=" MONDAY "), 0, 0, 1, 1)
START_TIME_SECS = int(settings.start_hour.total_seconds())
END_TIME_SECS = int(settings.end_hour.total_seconds())
INTERVAL_SECS = int(settings.interval.total_seconds())
for x in range(START_TIME_SECS, END_TIME_SECS, INTERVAL_SECS):
_time = seconds_to_time(x)
_label = Gtk.Label(label=str(_time))
self.grid.attach(_label, x, 0, 1, 1)
I could not find anything online or someone having the same error, that’s why I’m here.
While it doesn’t make much sense, I tried doing some (limited) testing. So after restarting a few times my computer, I think these are some of the causes:
- Commenting the for loop seems to do stop it from crashing and a window appears
- Commenting the set_column_homogeneous stops it from crashing and the contents from the for loop appears.
- (with the for loop commented) Adding one or two items to the grid doesn’t seem to crash my computer.
For some clarification, by crash I mean:
- gets stuck for a while
- my computer is unusable but music is still going abd my cursor moves
- the window appears after a while with the everything working, however my computer starts freaking out
- now everything is unusable and sometimes a black screen appears and disappears quickly (with the color from the login page, so the system’s default)
I could only restart my computer.
If anyone knows anything, please let me know.
Cheers,
– Mas