added a clock
This commit is contained in:
parent
3d3f24045e
commit
56627de333
Binary file not shown.
@ -188,6 +188,22 @@
|
|||||||
<property name="position">1</property>
|
<property name="position">1</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</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>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
# Gtk imports
|
|
||||||
|
|
||||||
# Python imports
|
# Python imports
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
# Gtk imports
|
||||||
|
from gi.repository import GObject
|
||||||
|
|
||||||
# Application imports
|
# Application imports
|
||||||
|
|
||||||
@ -9,6 +11,23 @@ class CrossClassSignals:
|
|||||||
def __init__(self, settings):
|
def __init__(self, settings):
|
||||||
self.settings = settings
|
self.settings = settings
|
||||||
self.builder = self.settings.returnBuilder()
|
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):
|
def closePopup(self, widget, data=None):
|
||||||
|
Loading…
Reference in New Issue
Block a user