JosanG 1 Posted April 9, 2015 Share Posted April 9, 2015 Hi all. I tried some times to customize my client's login windows by linking each visible button with a link to be opened in a new tab in web browser. I've truly no idea about how to do that, so i would appreciate any kind of help you can give to me. Thank you in advance! 1 Link to comment Share on other sites More sharing options...
Premium V0iĐ 115 Posted April 9, 2015 Premium Share Posted April 9, 2015 (edited) Try: define a button e.g.: def OpenWebPage(): import webbrowser webbrowser.open_new_tab("Write Here Your URL") Edit1: Source: https://docs.python.org/2/library/webbrowser.html Edited April 9, 2015 by EzionX 3 Link to comment Share on other sites More sharing options...
JosanG 1 Posted April 9, 2015 Author Share Posted April 9, 2015 Hi cCorax, thank you so much for your reply. Buttons are already defined, but when pressed in the login windows, appears no further action. I've looked in syserr and couldn't find an error in here about that problem. Ty again! Link to comment Share on other sites More sharing options...
JosanG 1 Posted April 10, 2015 Author Share Posted April 10, 2015 Bump. I would appreciate any kind of help or idea. Thank you! Link to comment Share on other sites More sharing options...
JosanG 1 Posted April 12, 2015 Author Share Posted April 12, 2015 May i do another bump? Link to comment Share on other sites More sharing options...
The Naid 120 Posted April 13, 2015 Share Posted April 13, 2015 def __youtube(self): os.system("start " + "http://youtube.com") Link to comment Share on other sites More sharing options...
Vectors_ 13 Posted April 13, 2015 Share Posted April 13, 2015 def __xx(self): import os os.startfile('http://www.google.com') Link to comment Share on other sites More sharing options...
Active Member Koray 2014 Posted April 13, 2015 Active Member Share Posted April 13, 2015 If you want open url in ingame browser def OpenWebWindow(self): width, height = int(max(wndMgr.GetScreenWidth() / 2, 800)), int(min(wndMgr.GetScreenHeight() / 1.5, 600)) x, y = wndMgr.GetScreenWidth() / 2 - width / 2, wndMgr.GetScreenHeight() / 2 - height / 2 self.webWindow = ui.BoardWithTitleBar() self.webWindow.AddFlag("movable") self.webWindow.AddFlag("attach") self.webWindow.SetSize(width, height) self.webWindow.SetPosition(x, y) app.ShowWebPage("http://google.com", (x+10, y+40, x+width-20, y+height-40)) self.webWindow.Show() self.webWindow.SetTop() def HideWebWindow(self): self.webWindow.Hide() app.HideWebPage() If you want open url in normal web browser def OpenUrlWithBrowser(self): import os url="http://google.com" os.popen("start %s" % (url)) Link to comment Share on other sites More sharing options...
Active Member Exygo 1098 Posted April 13, 2015 Active Member Share Posted April 13, 2015 Unfourtunately none of this working,,, https://www.youtube.com/channel/UCQ8mAeda9TWq6SsTzB53emw/videos Link to comment Share on other sites More sharing options...
JosanG 1 Posted April 14, 2015 Author Share Posted April 14, 2015 Up! I need some help with that, I know that would helps so much people if this get solved. Is all done right, but when pressing button just does nothing. Thank you again! Link to comment Share on other sites More sharing options...
Premium GatoaH 4 Posted April 14, 2015 Premium Share Posted April 14, 2015 I Love This ! Link to comment Share on other sites More sharing options...
Seru 11 Posted April 16, 2015 Share Posted April 16, 2015 I'm a friend of JosanG. #bump Link to comment Share on other sites More sharing options...
Seru 11 Posted April 18, 2015 Share Posted April 18, 2015 #up Link to comment Share on other sites More sharing options...
Seru 11 Posted April 24, 2015 Share Posted April 24, 2015 #up Link to comment Share on other sites More sharing options...
Seru 11 Posted April 26, 2015 Share Posted April 26, 2015 #up Link to comment Share on other sites More sharing options...
Seru 11 Posted April 28, 2015 Share Posted April 28, 2015 up... Link to comment Share on other sites More sharing options...
Seru 11 Posted May 2, 2015 Share Posted May 2, 2015 up .-. Link to comment Share on other sites More sharing options...
Seru 11 Posted May 3, 2015 Share Posted May 3, 2015 up Link to comment Share on other sites More sharing options...
Seru 11 Posted May 5, 2015 Share Posted May 5, 2015 Nobody knows what is happening? Really? Link to comment Share on other sites More sharing options...
Seru 11 Posted May 9, 2015 Share Posted May 9, 2015 up Link to comment Share on other sites More sharing options...
Seru 11 Posted May 11, 2015 Share Posted May 11, 2015 bump ._. Link to comment Share on other sites More sharing options...
Premium V0iĐ 115 Posted May 12, 2015 Premium Share Posted May 12, 2015 This is the my version: loginwindow.py (in locale): { "name" : "WepPageButton", "type" : "button", "x" : , #write here the x coordinate "y" : , #write here the y coordinate "default_image" : "d:/ymir work/ui/public/large_button_01.sub", "over_image" : "d:/ymir work/ui/public/large_button_02.sub", "down_image" : "d:/ymir work/ui/public/large_button_03.sub", "text" : , #write here the button text }, intrologin.py (in root) search: import uiScriptLocale Write under: import webbrowser Now search: self.loginExitButton = GetObject("LoginExitButton") Write under: self.WepPageButton = GetObject("WepPageButton") Now search: self.loginExitButton.SetEvent(ui.__mem_func__(self.__OnClickExitButton)) Write under: self.WepPageButton.SetEvent(ui.__mem_func__(self.__WebPageTest)) Now create this function: def __WebPageTest(self): webbrowser.open_new("write here your url") The last thing put this, in the lib folder: This is the hidden content, please Sign In or Sign Up 18 1 11 Link to comment Share on other sites More sharing options...
Seru 11 Posted May 12, 2015 Share Posted May 12, 2015 Finally! Thank you very much!! #Resolved Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now