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

Example on Window signal files_dropped #10318

Open
thiagola92 opened this issue Nov 25, 2024 · 0 comments
Open

Example on Window signal files_dropped #10318

thiagola92 opened this issue Nov 25, 2024 · 0 comments
Labels

Comments

@thiagola92
Copy link
Contributor

Your Godot version:
v4.4.dev3.official [f4af8201b]

Issue description:
In the signal files_dropped, the example use get_viewport():

func _ready():
	get_viewport().files_dropped.connect(on_files_dropped)

func on_files_dropped(files):
	print(files)

Wouldn't be more appropriated to use get_window()?

func _ready():
	get_window().files_dropped.connect(on_files_dropped)

func on_files_dropped(files):
	print(files)

There is any guarantee that get_viewport() will always return a Window? Is important because the signal files_dropped only exists in Windows, this could cause an error otherwise.

URL to the documentation page:
https://docs.godotengine.org/en/stable/classes/class_window.html#class-window-signal-files-dropped

@thiagola92 thiagola92 added the bug label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant