Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web browser buttons don't working... #6

Open
lyushher opened this issue Oct 24, 2021 · 3 comments
Open

Web browser buttons don't working... #6

lyushher opened this issue Oct 24, 2021 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested

Comments

@lyushher
Copy link
Owner

lyushher commented Oct 24, 2021

When user clicks the button, it should open the web browser that should open to the user.
I need help, how can I do it?

I have to add web browser to this button;

google_btn = tk.Button(frame,text ="G",fg="green", font=("Gill Sans", 34))
google_btn.place(relx=0.165 , rely=0.35, relwidth=0.03, relheight=0.035)
go = tk.Label(text="Google", font=("Gill Sans", 20),bg="#FFFEF7")
go.place(relx=0.34, rely=0.77)

You can see the rest of the my codes here.

@lyushher lyushher added bug Something isn't working help wanted Extra attention is needed question Further information is requested labels Oct 24, 2021
@ghost
Copy link

ghost commented Oct 26, 2021

Oooh, the joys of Tkinter.

See https://stackoverflow.com/questions/6874525/how-to-handle-a-button-click-event/6875555

Define a function, and in that, redirect the web browser. Then attach that function to the button. Should look like:

def helloworld():
  print("hello world")

helloworld_btn = tk.Button(window, command=helloworld, text="hi")

@lyushher
Copy link
Owner Author

Thank you so much! I will try it later..

@ghost
Copy link

ghost commented Oct 26, 2021

np

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant