Hi,

I have the following code. I am exactly following the instructions and
guidelines that you guys have helped me with but the window wouldn't show
the button no matter what I do:

/*****************************************************************************************************************************************************************************************/

int Horizontal_Screen_Pixels()
{
    float h, v;
    Fl::screen_dpi(h,v);
    return static_cast<int>(h);
}

int Vertical_Screen_Pixels()
{
    float h, v;
    Fl::screen_dpi(h,v);
    return static_cast<int>(v);
}

int main(int argc, char **argv) {
    const int Win_Height = 175;
    const int Win_Width = 175;

    Fl_Window *window = new Fl_Window((Horizontal_Screen_Pixels()/2) -
(Win_Width/2),(Vertical_Screen_Pixels()/2) -
(Win_Height/2),Win_Width,Win_Height,"Hello World");
    window->color(FL_RED);
    window->box(FL_UP_BOX);
    Fl_Button *txt_username = new
Fl_Button(window->x()+10,window->y()+10,window->w()-(10+10),(window->h()/4)/2);
    txt_username->color(FL_BLUE);
    window->end();
    window->show(argc,argv);
    return Fl::run();
}


/*****************************************************************************************************************************************************************************************/

Can you tell me what I am doing wrong? I guess may be something is going
wrong because I want to pass relative sizes/positions derived from those of
the main windows(?).

Best regards, Asif
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to