Set Application Icon

22 views
Skip to first unread message

Bryan

unread,
Jul 7, 2008, 1:06:08 AM7/7/08
to wxMax
Is this code anywhere close to being on the right track:

appIcon = wxIcon.CreateFromFile("app.ico", wxBITMAP_TYPE_ICON)
myDialog.SetIcon(appIcon)

Just my guess...could someone help me out with this?

Thanks!
Bryan

Plash

unread,
Jul 10, 2008, 7:43:13 PM7/10/08
to wxMax
Just a guess, but are you calling wxInitAllImageHandlers() in your
wxApp's OnInit method?

P.S. You will probably get a lot more responses at
http://www.blitzbasic.com/Community/topics.php?forum=124

Júlio César Ködel

unread,
Jul 10, 2008, 7:57:34 PM7/10/08
to wx...@googlegroups.com
This one works even for PNG's (at least on Win32):

Self.SetIcon(wxIcon.CreateFromFile("MyImage.png", wxBITMAP_TYPE_PNG))

For Icons:

Self.SetIcon(wxIcon.CreateFromFile("MyIcon.ico", wxBITMAP_TYPE_ICO))

BTW... Why wxIcon.CreateFromFile does not accept "INCBIN::MyIcon.ico"? =(

--
[]
Júlio César Ködel G.

Bruce Henderson

unread,
Jul 20, 2008, 5:30:05 PM7/20/08
to wx...@googlegroups.com
It should accept incbin::

Just remember that you will need to import BRL.Ramstream if you want
to use incbin too.


Brucey

Bruce Henderson

unread,
Jul 20, 2008, 5:33:41 PM7/20/08
to wx...@googlegroups.com
You can either use wxInitAllImageHandlers() as Plash suggests, or you
could try :

wxImage.AddHandler(New wxICOHandler)

somewhere in your initialization code.

By default, only the BMP handler is enabled.

Brucey

Reply all
Reply to author
Forward
0 new messages