setting Window icon to application icon

Questions about wxWidgets running on MS.NET, mono or Portable.NET ? Ask it here !
Post Reply
dwmcqueen
Knows some wx things
Knows some wx things
Posts: 26
Joined: Thu Oct 28, 2004 11:02 am

setting Window icon to application icon

Post by dwmcqueen » Thu Oct 28, 2004 8:37 pm

Is there a way to extract the icon during runtime from the Application itself (the icon that appears on the application - it is specified during compilation) and using that icon as the Window's titlebar icon (instead of loading an icon from a file at runtime)?

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Thu Oct 28, 2004 8:49 pm

Hi!
Just asking: Is this really wx.NET related question? And could you please be a little bit more specific on what you want to do... (You mean the application Icon compiled via the resource and the title/taskbar icon, right?)
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

dwmcqueen
Knows some wx things
Knows some wx things
Posts: 26
Joined: Thu Oct 28, 2004 11:02 am

Post by dwmcqueen » Thu Oct 28, 2004 9:50 pm

"you mean the application Icon compiled via the resource and the title/taskbar icon"

Yes. I think it is a wxNet quetion since specifying the title/taskbar icon is a property in the wx.Frame class, correct? And the samples seem to load the icon from a file (Icon = new wx.Icon( "../Samples/Mdi/mondrian.png" );) - can this be done in a similar way by somehow loading whatever application Icon was compiled in (without loading the actual file icon at runtime)?

Bryan Bulten
In need of some credit
In need of some credit
Posts: 8
Joined: Thu Oct 28, 2004 11:45 pm
Location: Victoria, BC, Canada
Contact:

Post by Bryan Bulten » Fri Oct 29, 2004 12:01 am

This is not yet supported in wx.NET. If you're willing to take a hack at the .NET resource system, be my guest. :D

dwmcqueen
Knows some wx things
Knows some wx things
Posts: 26
Joined: Thu Oct 28, 2004 11:02 am

Post by dwmcqueen » Fri Oct 29, 2004 11:12 pm

I'll wait on that. On the other hand, can icons be compiled into the resulting executable and then referenced? Or is that the same question?

Bryan Bulten
In need of some credit
In need of some credit
Posts: 8
Joined: Thu Oct 28, 2004 11:45 pm
Location: Victoria, BC, Canada
Contact:

Post by Bryan Bulten » Sat Oct 30, 2004 1:01 am

They can be compiled in an executable (at least with MS's .NET, not sure about Portable.NET or Mono). However, they can't be loaded through wx.NET.

If you want to do a work around, you could compile in the icons, then save them to temporary file at runtime, and load this using wx.NET's wx.Image class.

dwmcqueen
Knows some wx things
Knows some wx things
Posts: 26
Joined: Thu Oct 28, 2004 11:02 am

Post by dwmcqueen » Sat Oct 30, 2004 3:09 am

Great idea! Thanks!

Post Reply