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
Adding a 'setIcon' method to allow the Window's icon to be changed #10
Conversation
c829a66
to
d1395c4
Compare
Thanks for your contribution! For me it's better to use iconphoto since it allows attaching png images of various sizes. |
I tried that and got the following error:
This was my attempted implementation: public function setIcon(string $iconFilePath, $isDefaultForOtherWindows = false): self
{
$arguments = [];
if ($isDefaultForOtherWindows) {
$arguments[] = '-deafult';
}
$arguments[] = $iconFilePath;
return $this->setWm('iconphoto', $arguments);
} Since I am not familiar with Tcl/Tk at all, I went for the easier approach, which was to use PS.: Thank you for your work on this component. ⭐ |
Take a look at #13 and run one of the demos |
Now I get it. It's not just a matter of passing the path as a string. |
Currently the only way to set the icon is to call directly the protected method
setWm
. If we don't want to follow the approach of extendingMainWindow
we should still be able to set its icon.This PR addresses that concern, making public a
setIcon
method that receives the path for the icon bitmap file. As it was added to the docblock,/
should be used as directory separator even on Windows. When trying to use\
I received the following error: