From 155b9464c2d9e523b562a100e242f9f58cc5aaf6 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sat, 26 Apr 2008 05:11:19 -0500 Subject: [PATCH] Work around the fact that Fl::get_system_colors() only works once. --- Timeline/TLE.fl | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/Timeline/TLE.fl b/Timeline/TLE.fl index 72b0d6e..b9646ae 100644 --- a/Timeline/TLE.fl +++ b/Timeline/TLE.fl @@ -23,8 +23,7 @@ decl {\#include "Audio_File.H" // for supported formats} {} decl {\#include "Waveform.H" // for options} {} -decl {\#include "Region.H" // for options} {selected -} +decl {\#include "Region.H" // for options} {} decl {\#include "Control_Sequence.H" // for options} {} @@ -37,6 +36,8 @@ decl {extern char *user_config_dir;} {global class TLE {open } { + decl {Fl_Color system_colors[3];} {selected public + } decl {static void menubar_cb ( void *v )} {} decl {void menubar_cb ( void )} {} Function {menu_picked_value( const Fl_Menu_ *m )} {open return_type {static int} @@ -79,6 +80,9 @@ Fl::visible_focus( 0 ); Fl::get_system_colors(); Fl::scheme( "plastic" ); +system_colors[ 0 ] = (Fl_Color)Fl::get_color( FL_BACKGROUND_COLOR ); +system_colors[ 1 ] = (Fl_Color)Fl::get_color( FL_FOREGROUND_COLOR ); +system_colors[ 2 ] = (Fl_Color)Fl::get_color( FL_BACKGROUND2_COLOR ); Fl::add_timeout( STATUS_UPDATE_FREQ, update_cb, this ); @@ -108,7 +112,7 @@ free( path );} {} } { Fl_Window main_window { label {Non-DAW - Timeline} open - xywh {577 27 1024 768} type Double resizable xclass {Non-DAW} visible + xywh {577 50 1024 768} type Double resizable xclass {Non-DAW} visible } { Fl_Menu_Bar menubar {open xywh {0 0 1024 25} @@ -373,7 +377,21 @@ timeline->redraw();} } { MenuItem {} { label System - callback {Fl::get_system_colors(); + callback {//Fl::get_system_colors(); + +unsigned char r, g, b; + +Fl::get_color( system_colors[ 0 ], r, g, b ); + +Fl::background( r, g, b ); + +Fl::get_color( system_colors[ 1 ], r, g, b ); + +Fl::foreground( r, g, b ); + +Fl::get_color( system_colors[ 2 ], r, g, b ); + +Fl::background2( r, g, b ); Fl::scheme( Fl::scheme() );} xywh {0 0 40 25} type Radio