On 27 Mar 2010, at 18:49, Albrecht Schlosser wrote:
> On 27.03.2010, at 18:56, Robin Rowe wrote:
>
>>
>> Do I write my own theme? How? What function calls do I need to make?
>
> There are functions to change the internal colors ("gray ramp"), and
> you can set colors for all widgets individually, and you can write
> your
> own box drawing functions ("theme"), but I can't tell you what to do
> off the top of my head. RTFM ;-)
If it's just setting the widget colours, it should not be as hard as
writing a theme, just a matter of setting the correct fg and bg (and
probably edge) colours for the basic widget rendering.
One thing that might be worth a try is, when you call show() on your
widgets (especially the very first window that you show), just call
mywindow->show(); rather than the recommended practice of calling
mywindow->show(argc, argv);
The reason is: the show(argc, argv) call, on showing the first window
of your app, attempts to read the system default colours and use
them, but the values that win7 reports can be a bit odd with all the
fancy semi-transparent compositing they do...
If you just call show() with no args, you should get the default fltk
grey ramp, which was hard-coded to look a bit like win95 or fvwm or
some such thing back in the day, but might actually look less wrong
in this instance...
>> Is there an FLTK call that tells me what platform and OS version
>> I'm on so I know to tweak it when it's Win7?
>
> Not a FLTK call, but someone (Ian?) posted such code for all platforms
> some time ago.
Yup - I have that code... but I can't find it right now... erm...
well, linux/X11 and OSX are easy to do, you "detect" them at compile
time, so that's not a problem.
For winXX platforms, you use GetVersion() or, better, use GetVersionEx
() and look for the major.minor version ID's.
Vista is 6.0, win7 is 6.1, so if you find a major.minor of 6.1 or
higher you can use you alternate colour scheme and hope for the best!
Caution - random code from memory follows...
#ifdef _WIN32
OSVERSIONINFO osvi;
BOOL bWin7;
memset(&osvi, 0, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osvi);
bWin7 =
( (osvi.dwMajorVersion > 6) ||
( (osvi.dwMajorVersion == 6) && (osvi.dwMinorVersion >= 1) ));
if(bWin7) {
printf("This is Win7 or higher\n");
}
else {
printf("Less than Win7\n");
}
#else
// look for OSX or X11 then...
#endif
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk