def SetSmallText(self,text): l = MultiLabel() l.SetCanvasHWND(self._Parent._CanvasHWND) l.Init(text,self._Fonts["small"]) self._Labels["Small"] = l #if self._Labels["Small"]._Width > self._Width: # self._Width = self._Labels["Small"]._Width if self._Labels["Small"]._Height >= self._Height: self._Height = self._Labels["Small"]._Height+10
def __init__(self): Page.__init__(self) self._CityLabel = Label() self._TempLabel = Label() self._TempSummaryLabel = MultiLabel() self._WeatherSummaryLabel = MultiLabel() self._SummarySunLabel = MultiLabel() self._ErrorLabel = Label() self._Icons = {} self._Fonts = {} try: with open( os.path.dirname(os.path.abspath(__file__)) + '/config.json', 'r') as f: config = json.load(f) self._api_key = config['api'] self._location = config['location'] except Exception, e: print("read 'weather/config.json' error: %s" % str(e)) self._errorText = "Error: Check your 'config.json' file"
def Init(self): self._PosX = self._Index * self._Screen._Width self._Width = self._Screen._Width self._Height = self._Screen._Height self._CanvasHWND = self._Screen._CanvasHWND li = MultiLabel() li.SetCanvasHWND(self._CanvasHWND) li._Width = 160 li.Init(self._ConfirmText,self._ListFont) li._PosX = (self._Width - li._Width)/2 li._PosY = (self._Height - li._Height)/2 self._BGPosX = li._PosX-20 self._BGPosY = li._PosY-20 self._BGWidth = li._Width+40 self._BGHeight = li._Height+40 self._MyList.append(li)