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
This commit is contained in:
Bill Spitzak 1999-11-20 09:17:21 +00:00
parent c05eed1e54
commit ec8a580634
2 changed files with 15 additions and 9 deletions

View File

@ -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 $".
//

View File

@ -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 $".
//