link to a website?

Hi
as I can put a link to a web on a DirectButton?
Thanks!

If you want to open link in browser:

import webbrowser
webbrowser.open_new_tab('https://panda3d.org')

docs.python.org/2/library/webbrowser.html

But if you want to show web page inside P3D window - you should use third party library like awesomium I think

Something like this?

#!/usr/bin/env python
import sys
import webbrowser

from direct.showbase.ShowBase import ShowBase
from direct.gui.DirectGui import DirectButton

def open_link():
  webbrowser.open_new_tab('https://panda3d.org')

s = ShowBase()

b = DirectButton(text       = ("OK", "click!", "rolling over", "disabled"),
                 text_scale = 0.1,
                 frameColor = (0.6, 0.6, 0.6, 1.0),
                 frameSize  = (-0.3, 0.3, -0.3, 0.3),
                 pos        = (0.0, 0.0, -0.7),
                 command=open_link)

s.accept("escape", sys.exit)
s.run()

Thanks for your information, easy, effective and fast, thanks.

Thanks for your information, fairly complete, thanks.