MCPcopy Create free account
hub / github.com/ActiveState/code / Get

Method Get

recipes/Python/475155_Dynamic_system_tray/recipe-475155.py:28–54  ·  view source on GitHub ↗
(self,l,r)

Source from the content-addressed store, hash-verified

26 # \brief gets a new icon with 0 <= l,r <= 5
27 #
28 def Get(self,l,r):
29 s=""+self.s_line
30 for i in range(5):
31 if i<(5-l):
32 sl = self.sl_off
33 else:
34 sl = self.sl_on
35
36 if i<(5-r):
37 sr = self.sr_off
38 else:
39 sr = self.sr_on
40
41 s+=self.s_border+sl+self.s_point+sr+self.s_point
42 s+=self.s_border+sl+self.s_point+sr+self.s_point
43 s+=self.s_line
44
45 image = wx.EmptyImage(16,16)
46 image.SetData(s)
47
48 bmp = image.ConvertToBitmap()
49 bmp.SetMask(wx.Mask(bmp, wx.WHITE)) #sets the transparency colour to white
50
51 icon = wx.EmptyIcon()
52 icon.CopyFromBitmap(bmp)
53
54 return icon
55
56##
57# The TaskBarIcon class

Callers 5

getDefaultDNFunction · 0.45
__getattr__Method · 0.45
SetIconBarMethod · 0.45
recipe-109357.pyFile · 0.45
getMethod · 0.45

Calls 1

rangeFunction · 0.85

Tested by

no test coverage detected