FLTK logo

problems for input Widget in a browser

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.opengl  ]
 
Previous Message ]New Message | Reply ]Next Message ]

problems for input Widget in a browser goodwood Feb 12, 2012  
 
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 ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.