|
|
Dear all,
please see the following code, it simply puts two input widgets into a browser. But it's running, the caption of the input widget won't appear unless setting its align as "INSIDE" (compare input1 and input2). And the mouse cannot correctly position the text in the input windows.
Helps are greatly appreciate. thanks in advance.
//using fltk2
#include <stdio.h>
#include <stdlib.h>
#include <fltk/Input.h>
#include <fltk/Browser.h>
#include <fltk/Window.h>
#include <fltk/events.h>
#include <fltk/run.h>
#include <fltk/Menu.h>
int main()
{
fltk::Window * w = new fltk::Window (200, 400 , "test");
w->begin();
fltk::Browser *br = new fltk::Browser (1, 1, 180, 380, "browser");
w->end();
fltk::Input *inp1 = new fltk::Input(1, 1, 100, 20, "input1");
inp1->value("this is input1.");
fltk::Input *inp2 = new fltk::Input(1, 1, 100, 20, "input2");
inp2->align(fltk::ALIGN_LEFT | fltk::ALIGN_INSIDE);
inp2->value("this is input2.");
fltk::Group *node = br->add_group("node", br);
fltk::Group *sub_node = br->add_group("sub_node", node);
sub_node->add(inp1);
sub_node->add(inp2);
w->show();
return fltk::run();
}
[ Direct Link to Message ] | |
|
| |