added a clock

This commit is contained in:
Maxim Stewart 2020-03-29 23:25:58 -05:00
parent 3d3f24045e
commit 56627de333
3 changed files with 37 additions and 2 deletions

Binary file not shown.

View File

@ -188,6 +188,22 @@
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="timeLabel">
<property name="width_request">126</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="track_visited_links">False</property>
<attributes>
<attribute name="scale" value="1.5"/>
</attributes>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>

View File

@ -1,6 +1,8 @@
# Gtk imports
# Python imports
from datetime import datetime
# Gtk imports
from gi.repository import GObject
# Application imports
@ -9,6 +11,23 @@ class CrossClassSignals:
def __init__(self, settings):
self.settings = settings
self.builder = self.settings.returnBuilder()
self.timeLabel = self.builder.get_object("timeLabel")
self.displayclock()
self.startClock()
# Displays Timer
def displayclock(self):
now = datetime.now()
# timeStr = now.strftime("%H:%M %m/%d/%y")
timeStr = now.strftime("%I:%M %p %m/%d/%y")
self.timeLabel.set_label(timeStr)
return True
# Starting or clock
def startClock(self):
GObject.timeout_add(59000, self.displayclock)
def closePopup(self, widget, data=None):