Jonathan wrote: > I'm trying to compile my app with an icon I created. I've been > through many of the posts here but I wasn't able to compile the icon > as a resource. When compiling the .rc file, I get errors like: "; > expected before constant".
What do you have in your .rc file? If all you are doing is loading an icon resource, it really doesn't need very much at all... OK, here's some example files cut 'n pasted from one of my projects, that only loads an icon resource. This code is used to build on Vista and WinXP, for what that's worth. --------------------------------------------------------------- // // "$Id: win32icon.rc 81 2009-06-03 09:18:20Z imm $" // // Win32 icon resource file #include "win32icon.h" // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDI_ICON ICON DISCARDABLE "media/fn-edit-icon.ico" // End of file --------------------------------------------------------------- // // "$Id: win32icon.h 81 2009-06-03 09:18:20Z imm $" // // Win32 icon resource header file #define IDI_ICON 101 // End of file --------------------------------------------------------------- You'll need to edit the path in the .rc file, to the actual .ico file, to match your build tree, but otherwise these files ought to work pretty much as-is. > I used a program once to "re-compile" the EXE file and add an icon to > it. Would that icon show up in FLTK's window(s) as well? Possibly - not sure what you are asking here. But the easy thing to do is just use your resource compiler to compile the .rc file and just link it into your app in the usual way. > What about icon sizes (Vista's are much bigger than XP's), is that > covered by FLTK? FLTK doesn't really handle the icons at all - it hands them off to the underlying window manager (Windows in your case) so as long as your icon file is well formed, there's nothing to worry about. Remember, too, that the .ico format is designed to hold multiple images of different sizes. If you need to target Vista and WinXP (say) then if you create an .ico file that has a range of images in it, with the biggest as 128x128 and the smallest 16x16, and a few other intermediate sizes (maybe 48x48 and 32x32 say) then the windowing system will pick the closest size for what it currently needs and it all pretty much just works. Note also that if you just use one size (even 16x16 works) then it will be automatically rescaled for you anyway... > Also, when using show(argc,argv) instead of show(), the colors change > (they get brighter). This isn't so bad for some of my windows but I'd > like to keep the buttons darker. I guess it'll require some work but > hopefully it can be done. Yes that is intended. Indeed it is even in the docs... If you call show(argc,argv) then the fltk runtime will attempt to query the underlying system to determine the currently selected colour palette etc. and use that - the intent obviously being to make your fltk app blend in better with the current desktop configuration. If you use the "simple" version of show() that first time, then fltk uses its default colour scheme unmodified. (For the record you can achieve the same effect as calling show(argc,argv) by calling Fl::get_system_colors(); - although it sounds like you want to attain the opposite effect!) However, in any case the widgets will respond correctly if you explicitly set the colours, so you can make them any shade you like (although it is a bit more work to code of course.) _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

