summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Spitzak <spitzak@gmail.com>1999-11-20 09:17:21 +0000
committerBill Spitzak <spitzak@gmail.com>1999-11-20 09:17:21 +0000
commitec8a5806343ac6613022641862aada53ee189693 (patch)
tree7c1f699e53bbc7172f5a563105955e4f134c85ca
parentc05eed1e54567142f2d5558e5901301041597152 (diff)
Running with -c on a file with browsers in it does not require X
DISPLAY to be set. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.0@896 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--fluid/factory.cxx18
-rw-r--r--fluid/fluid.cxx6
2 files changed, 15 insertions, 9 deletions
diff --git a/fluid/factory.cxx b/fluid/factory.cxx
index eb5cc67b5..652a247a4 100644
--- a/fluid/factory.cxx
+++ b/fluid/factory.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: factory.cxx,v 1.4.2.3 1999/08/05 09:01:25 bill Exp $"
+// "$Id: factory.cxx,v 1.4.2.4 1999/11/20 09:17:20 bill Exp $"
//
// Widget factory code for the Fast Light Tool Kit (FLTK).
//
@@ -136,6 +136,8 @@ static Fl_Round_Button_Type Fl_Round_Button_type;
////////////////////////////////////////////////////////////////
+extern int compile_only;
+
#include <FL/Fl_Browser.H>
static Fl_Menu_Item browser_type_menu[] = {
{"No Select",0,0,(void*)FL_NORMAL_BROWSER},
@@ -150,10 +152,14 @@ public:
virtual const char *type_name() {return "Fl_Browser";}
Fl_Widget *widget(int x,int y,int w,int h) {
Fl_Browser* b = new Fl_Browser(x,y,w,h);
- char buffer[20];
- for (int i = 1; i <= 20; i++) {
- sprintf(buffer,"Browser Line %d",i);
- b->add(buffer);
+ // Fl_Browser::add calls fl_height(), which requires the X display open.
+ // Avoid this when compiling so it works w/o a display:
+ if (!compile_only) {
+ char buffer[20];
+ for (int i = 1; i <= 20; i++) {
+ sprintf(buffer,"Browser Line %d",i);
+ b->add(buffer);
+ }
}
return b;
}
@@ -687,5 +693,5 @@ int lookup_symbol(const char *name, int &v, int numberok) {
}
//
-// End of "$Id: factory.cxx,v 1.4.2.3 1999/08/05 09:01:25 bill Exp $".
+// End of "$Id: factory.cxx,v 1.4.2.4 1999/11/20 09:17:20 bill Exp $".
//
diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx
index c43f7fcca..c52725664 100644
--- a/fluid/fluid.cxx
+++ b/fluid/fluid.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: fluid.cxx,v 1.15.2.1 1999/04/18 23:43:42 mike Exp $"
+// "$Id: fluid.cxx,v 1.15.2.2 1999/11/20 09:17:21 bill Exp $"
//
// FLUID main entry for the Fast Light Tool Kit (FLTK).
//
@@ -158,7 +158,7 @@ void new_cb(Fl_Widget *, void *v) {
modflag = 0;
}
-static int compile_only = 0;
+int compile_only = 0;
int header_file_set = 0;
int code_file_set = 0;
const char* header_file_name = ".h";
@@ -428,5 +428,5 @@ int main(int argc,char **argv) {
}
//
-// End of "$Id: fluid.cxx,v 1.15.2.1 1999/04/18 23:43:42 mike Exp $".
+// End of "$Id: fluid.cxx,v 1.15.2.2 1999/11/20 09:17:21 bill Exp $".
//