summaryrefslogtreecommitdiff
path: root/test/browser.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-11-02 20:38:15 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-11-02 20:38:15 +0000
commit18caedc1c55c6819456c83db3cc98866a7debbbb (patch)
tree198e2cedd57cd22e792a1d5365eb27f09875987c /test/browser.cxx
parent28295ae0e903ffbce95424695e03744f78cdbd26 (diff)
Removed the "Microsoft" button from the menu demo.
Added a number check for the browser demo, and changed the input field to an Int_Input widget. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1675 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test/browser.cxx')
-rw-r--r--test/browser.cxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/test/browser.cxx b/test/browser.cxx
index 14287e068..e9cb1e088 100644
--- a/test/browser.cxx
+++ b/test/browser.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: browser.cxx,v 1.5.2.6 2001/01/22 15:13:41 easysw Exp $"
+// "$Id: browser.cxx,v 1.5.2.6.2.1 2001/11/02 20:38:15 easysw Exp $"
//
// Browser test program for the Fast Light Tool Kit (FLTK).
//
@@ -63,7 +63,8 @@ That was a blank line above this.
#include <FL/Fl_Select_Browser.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Button.H>
-#include <FL/Fl_Input.H>
+#include <FL/Fl_Int_Input.H>
+#include <FL/fl_ask.H>
#include <stdio.h>
#include <string.h>
#include <errno.h>
@@ -74,7 +75,7 @@ Fl_Button *top,
*bottom,
*middle,
*visible;
-Fl_Input *field;
+Fl_Int_Input *field;
void b_cb(Fl_Widget* o, void*) {
printf("callback, selection = %d, event_clicks = %d\n",
@@ -84,6 +85,12 @@ void b_cb(Fl_Widget* o, void*) {
void show_cb(Fl_Widget *o, void *) {
int line = atoi(field->value());
+ if (!line) {
+ fl_alert("Please enter a number in the text field\n"
+ "before clicking on the buttons.");
+ return;
+ }
+
if (o == top)
browser->topline(line);
else if (o == bottom)
@@ -112,7 +119,7 @@ int main(int argc, char **argv) {
}
browser->position(0);
- field = new Fl_Input(50, 350, 350, 25, "Line #:");
+ field = new Fl_Int_Input(50, 350, 350, 25, "Line #:");
field->callback(show_cb);
top = new Fl_Button(0, 375, 100, 25, "Top");
@@ -133,6 +140,6 @@ int main(int argc, char **argv) {
}
//
-// End of "$Id: browser.cxx,v 1.5.2.6 2001/01/22 15:13:41 easysw Exp $".
+// End of "$Id: browser.cxx,v 1.5.2.6.2.1 2001/11/02 20:38:15 easysw Exp $".
//