-
Notifications
You must be signed in to change notification settings - Fork 16
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 application icon? #7
Comments
Hi, how are you trying to create your window? If you created using StandAloneContainer, you are able to use the setWindowIcon over it. If that doesn't work for you, can you post here what you tried please? Thanks |
The main window is BaseWidget class, and I think created the main window with start_app. I was looking at the start_app code and it doesn't directly expose the SandAloneContainer. How should I be creating the main window? |
Have you tried accessing the main window through the object that you passed to the start_app? If you aren't able to do that, and if you can, post the code you tried please. |
not really sure how to do that, it looks like app_main_window is a property of StandAloneContainer which is created inside start_app but not directly exposed. Am I missing something? The app I am trying to create is a simple app with just a couple of buttons. I'm not sure how to access the passed object. If is initiate it with mydrives=MyDrives(), mydrives.a_main_window.setWindowIcon(icon) gives an error. mydrives.py
|
Hi, I added the possibility to set the main window icon through a user settings file. Currently is still in the develop branch but will soon (hopefully during next week) be released with a new update on pip for pyforms-gui. The way that afterwards you should use it is to have a file where you would put your application settings (e.g., settings.py) in your module's folder. There you will be able to set an entry with
With that, your code would change to: if __name__ == '__main__':
import settings as user_settings
from pyforms import start_app
start_app(MyDrives, user_settings=user_settings) start_app will handle that setting if it is defined and you should be seeing your icon as expected. Thanks for pointing this out. I will close this issue when the new release is out. Edited: The code to get the icon path setting so the use will be simpler. |
Excellent thank you! |
In a similar way could you allow the use of showNormal or showMinimzed rather then showMaximized |
You can update to the new minor version with pip right now. |
Thank you this works great |
How do you set the application icon? setWindowIcon does not seem to do anything
The text was updated successfully, but these errors were encountered: