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:
@@ -8,7 +8,7 @@ Requirement
|
|||||||
|
|
||||||
- Python3
|
- Python3
|
||||||
- PyCairo
|
- PyCairo
|
||||||
- PyGObject
|
- PyGObject (GTK3)
|
||||||
|
|
||||||
Configuration
|
Configuration
|
||||||
-------------
|
-------------
|
||||||
@@ -68,7 +68,7 @@ and the result:
|
|||||||
.. image:: /images/vertical.png
|
.. image:: /images/vertical.png
|
||||||
:alt: single clock
|
:alt: single clock
|
||||||
|
|
||||||
Same in horizontal arragement:
|
Same in horizontal arrangement:
|
||||||
|
|
||||||
.. code:: yaml
|
.. code:: yaml
|
||||||
|
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ import sys
|
|||||||
import cairo
|
import cairo
|
||||||
import gi
|
import gi
|
||||||
gi.require_version("Gtk", "3.0")
|
gi.require_version("Gtk", "3.0")
|
||||||
|
from gi.repository import GLib
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
from gi.repository import GObject
|
|
||||||
import pytz
|
import pytz
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ class Clocks(Gtk.DrawingArea):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
self.connect('draw', self._draw)
|
self.connect('draw', self._draw)
|
||||||
GObject.timeout_add(100, self.on_timeout)
|
GLib.timeout_add(100, self.on_timeout)
|
||||||
win = Gtk.Window()
|
win = Gtk.Window()
|
||||||
win.set_title('World Clock')
|
win.set_title('World Clock')
|
||||||
win.set_resizable(not self.disable_resize)
|
win.set_resizable(not self.disable_resize)
|
||||||
|
|||||||
Reference in New Issue
Block a user