JavaScripter98
JavaScripter98

Reputation: 61

How do I add an icon to my app in wxpython?

I'm messing around with wxpython and I want to make a good app, and I want an icon for my app. (I mean on the actual window not the taskbar.)

I've already read How to set icon on wxFrame?. But where do I put the path to my icon in the wx.EmptyIcon()? I really don't understand how to do this. Any help?

Sorry for the bad english!

Upvotes: 1

Views: 633

Answers (1)

JavaScripter98
JavaScripter98

Reputation: 61

Alright, for anyone who wants to know, I figured it out. You need to use this code:

frame.SetIcon(wx.Icon("C:\\Users\\JScripter98\\Downloads\\scissors.png"))

(the path can be anything you want)

This sets the icon to your main frame. The path should have two \'s in it so python knows it's a file path.

Upvotes: 1

Related Questions