MCPcopy Create free account
hub / github.com/PlayOnLinux/POL-POM-4 / menuGaucheAddLink

Method menuGaucheAddLink

python/mainwindow.py:848–880  ·  view source on GitHub ↗
(self, id, text, pos, image, evt, url=None)

Source from the content-addressed store, hash-verified

846 self.menuElem[id].SetFont(self.fontTitre)
847
848 def menuGaucheAddLink(self, id, text, pos, image, evt, url=None):
849 if (os.path.exists(image)):
850 menu_icone = image
851 else:
852 menu_icone = Variables.playonlinux_env + "/etc/playonlinux.png"
853
854 try:
855 self.bitmap = wx.Image(menu_icone)
856 self.bitmap.Rescale(16, 16, wx.IMAGE_QUALITY_HIGH)
857 self.bitmap = self.bitmap.ConvertToBitmap()
858 self.menuImage[id] = wx.StaticBitmap(self.menu_gauche, id=-1, bitmap=self.bitmap, pos=(10, 15 + pos * 20))
859
860 except:
861 pass
862
863 if (url == None):
864 self.menuElem[id] = wx.lib.agw.hyperlink.HyperLinkCtrl(self.menu_gauche, 10000 + pos, text,
865 pos=(35, 15 + pos * 20))
866 self.menuElem[id].AutoBrowse(False)
867 else:
868 self.menuElem[id] = wx.lib.agw.hyperlink.HyperLinkCtrl(self.menu_gauche, 10000 + pos, text,
869 pos=(35, 15 + pos * 20))
870 self.menuElem[id].setURL(url)
871
872 self.menuElem[id].SetColours(wx.Colour(0, 0, 0), wx.Colour(0, 0, 0), wx.Colour(0, 0, 0))
873 self.menuElem[id].UpdateLink(True)
874 # self.menuElem[id].SetVisited(False)
875 # self.menuElem[id].SetNormalColour(wx.Colour(0,0,0))
876 # self.menuElem[id].SetVisitedColour(wx.Colour(0,0,0))
877 # self.menuElem[id].SetHoverColour(wx.Colour(100,100,100))
878
879 if (evt != None):
880 self.Bind(wx.lib.agw.hyperlink.EVT_HYPERLINK_LEFT, evt, id=10000 + pos)
881
882 def donate(self, event):
883 if (os.environ["POL_OS"] == "Mac"):

Callers 1

generate_menuMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected