FLTK apps using Gtk2 theme colors when run in Mate?

125 views
Skip to first unread message

Will B

unread,
Mar 7, 2017, 12:00:47 AM3/7/17
to fltk.general
Greetings everyone,

I've noticed on my FLTK app that when run under Mate it uses my Gtk 2 theme colors (selected, background, text colors) however when I run the same FLTK app on Fluxbox, it uses the 'default' FLTK colors.

Are there some environment variables or other system-wide setting set somewhere to change these colors?  It would be my preference for my FLTK apps to use Gtk 2 theme colors.

  'Default' colors

https://www.pismotek.com/media/fltk-colors-default.png


  Gtk 2 theme colors

https://www.pismotek.com/media/fltk-colors-gtk.png










Thank you in advance and God bless you! :-)

Will Brokenbourgh




Will B

unread,
Mar 7, 2017, 12:07:49 AM3/7/17
to fltk.general
On closer inspection, the Gtk colors seem to be coming from my Gtk *3* theme, not the Gtk 2 theme.  Thought I'd clarify that. :-)

Will Brokenbourgh

Greg Ercolano

unread,
Mar 7, 2017, 12:11:26 AM3/7/17
to fltkg...@googlegroups.com
On 03/06/17 21:00, Will B wrote:
> I've noticed on my FLTK app that when run under Mate it uses
> my Gtk 2 theme colors (selected, background, text colors)
> however when I run the same FLTK app on Fluxbox, it uses the 'default' FLTK colors.

Do you use show() or show(argc,argv) when showing the main window?
If the latter, that might explain it.

If you don't want the behavior, try the former -- calling show() with
no arguments -- and see if that makes it consistent.

Will B

unread,
Mar 7, 2017, 12:28:29 AM3/7/17
to fltk.general
On Monday, March 6, 2017 at 9:11:26 PM UTC-8, Greg Ercolano wrote:
Do you use show() or show(argc,argv) when showing the main window?
If the latter, that might explain it.

If you don't want the behavior, try the former -- calling show() with
no arguments -- and see if that makes it consistent.

Thanks Greg.

That indeed makes a difference, but actually I'd like my FLTK to use the Gtk 3 theme colors, no matter what DE is launching it.

Thanks again! :-)

Will Brokenbourgh

Edzard Egberts

unread,
Mar 7, 2017, 2:06:26 AM3/7/17
to 'ed' via fltk.general
Will B wrote:

> It would be my preference for my FLTK apps to use Gtk 2 theme colors.

You could call

Fl::scheme("gtk+");

at the beginning of your programs to get a Gtk scheme. I don't know,
whether this takes the colours from your system, but anyway this will
look gtk like on every window manager.

Will B

unread,
Mar 7, 2017, 10:43:20 AM3/7/17
to fltk.general
On Monday, March 6, 2017 at 11:06:26 PM UTC-8, ed_09 wrote:
 
You could call

        Fl::scheme("gtk+");

at the beginning of your programs to get a Gtk scheme. I don't know,
whether this takes the colours from your system, but anyway this will
look gtk like on every window manager.

Thanks for that.
Reply all
Reply to author
Forward
0 new messages