-
Notifications
You must be signed in to change notification settings - Fork 122
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
How to open URL with UrlImageTextButton widget? #651
Comments
I solved this problem in this way: testLink.click = (Widget source) {
import std.process : browse;
browse(source.action.stringParam);
return true;
}; But is this the right way? I think it should work automatically. |
I looked at it. The code does assign the action properly, but it might not be triggered for some reason. Sounds like a bug to me. |
I looked at it more closely, and here's what happens: dlangui/examples/example1/src/example1.d Line 228 in 51d1eab
I don't know what to feel about this design. If I were to try and understand the reasoning behind all this, it's to allow you to handle URL clicks in a non-specific way (eg check for malicious websites or whatnot). I'm thinking this is the intended way for it to work and not a bug. However, I can also understand that it's expected to work in a different way. Maybe, I can kludge in a way for it to work without any special shenanigans required. This would mean a cross-platform way of opening links is required. I'm promoting this from bug to enchancement though :) |
This is available in the standard library. Works if the default browser is set in the system. I tested in Windows and Linux (ubuntu, archlinux). |
How can I use this code to open the specified url when left clicking on the mouse? I check in Windows, it does nothing by itself. But why then specify the url?
The text was updated successfully, but these errors were encountered: