i write a program using resize function. but the widget does not being resized 
why?


#include <fltk/Button.h>
#include <fltk/Group.h>

void button_cb (Widget *w, void* v);
void input_cb (Widget *w, void* v);

class gp : public fltk::Group {


        public:
        fltk::Button *b;

        gp(int x, int y, int w, int h, char*l=0):fltk::Group(x,y,w,h,l,true){
                box(THIN_DOWN_BOX);
                b = new Button(10,20,40,40,"OK");
                b->callback(button_cb, (void*)this);
        }
        ~gp(){}
};


class g : public gp {


        public:
        fltk::Input *input;

        g(int x, int y, int w, int h, char*l=0):gp(x,y,w,h,l){
                //box(THIN_DOWN_BOX);
                input = new Input(100,20,40,40,"OK");
                input->hide();
                //input->box(THIN_DOWN_BOX);
                input->callback(input_cb, (void*)this);
                input->when(WHEN_ENTER_KEY_ALWAYS);
                //input->parent(this);
                add(input);
                end();
        }
        ~g(){}
};

void input_cb (Widget *w, void* v) {
        g* s =  (g*)v;
        //s->input->value("sss\n");

}


void button_cb (Widget *w, void* v) {

        g* s =  (g*)v;
        s->input->resize(20,100, 40, 120);
        //s->input->set_damage(DAMAGE_ALL);
        s->input->show();
        //s->update_child((Widget&)*(s->input));
        //((g*)s->input)->value("sss\n");

}

int main(){

Window window(w_window, h_window, "hhh");
g ge(20, 20, window.w()-80, window.h()-80, 0);
        window.add(ge);
        window.end();
        //window.resizable(table);

        window.show();

        return run();

}

_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to