Gtk widget minimum and maximum width/height with resizable to true

Viewed 2637

I am new to gtk and using gtkmm-3.0, what i am trying hard is to set the minimum width and height for the gtk widget. I used set_size_request method but the widget is still crossing its min/max size when i resize the parent container.

my code looks like

foo::foo()
{
    set_default_size(400,400); // set default size for window
    add(grid_layout);

    menu_bar.append(file);
    menu_bar.append(edit);
    menu_bar.append(project);
    menu_bar.append(settings);
    menu_bar.append(help);


    right_panel_notebook.insert_page(right_btn, "Page1", Gtk::POS_RIGHT);
    right_panel_notebook.insert_page(notebook_btn, "Page2", Gtk::POS_RIGHT);
    right_panel_notebook.set_size_request(400,300); // setting size for a Notebook widget       


    design_paned.set_vexpand(true);
    design_paned.add1(btn);
    design_paned.add2(right_panel_notebook);


    grid_layout.set_row_homogeneous(false);
    grid_layout.set_column_homogeneous(true);
    grid_layout.attach_next_to(menu_bar, Gtk::POS_RIGHT, 1,1);        
    grid_layout.attach_next_to(design_paned, Gtk::POS_BOTTOM, 1,1);        

    show_all();
}   

So, is there any way to restrict the widget's min/max size with its resizable to true.

1 Answers
Related