1
0
mirror of https://github.com/gryf/pygtkworldclock.git synced 2025-12-17 11:30:21 +01:00

Use GLib.timeout instead of GObject.timeout

This commit is contained in:
2023-03-21 08:08:39 +01:00
parent 5d129e54c4
commit 4527b518b6
2 changed files with 5 additions and 5 deletions

View File

@@ -35,8 +35,8 @@ import sys
import cairo
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import GLib
from gi.repository import Gtk
from gi.repository import GObject
import pytz
import yaml
@@ -191,13 +191,13 @@ class Clocks(Gtk.DrawingArea):
width = len(row) if len(row) > width else width
for col_no, conf in enumerate(row):
self._clocks.append(Clock(conf, row_no, col_no, self.size,
self.show_seconds))
self.show_seconds))
self.width = self.size * width
def run(self):
self.connect('draw', self._draw)
GObject.timeout_add(100, self.on_timeout)
GLib.timeout_add(100, self.on_timeout)
win = Gtk.Window()
win.set_title('World Clock')
win.set_resizable(not self.disable_resize)