Hi I'm new to GUI programming, so after trying PyQt for a short time I found Enaml which made the production much more easy.
I'm trying to have a widget that can change the value of a datetime.datetime object or a datetime.time object, but it turns out they are read-only. So how could I do that? Can I change the variable to have read-and-write attributes, or maybe need a setter?
My minimum working solution is:
from __future__ import print_function
import datetime
import os
from atom.api import Atom, Unicode, Range, Typed, observe, Value, Bool
class SimulationCase(Atom):
startDateTime = datetime.datetime.strptime('05.03.2015-5','%d.%m.%Y-%H')
currentDateTime = startDateTime
endDateTime = startDateTime+ datetime.timedelta(days=int(5))
incrementTime = datetime.time(1,0,0)
def main():
case = SimulationCase()
print(case.currentDateTime)
a = datetime.time(1,0,0)
print(a)
#This is where the problem occures, comment out the line under for a working solution.
case.incrementTime = a
if __name__ == '__main__':
main()