从屏幕截图中可以看到,按钮和小部件已拉伸。如何使它们正常大小?这是主要代码。
#include <gtkmm.h>
#include "w.h"
int main ( int argc, char **argv )
{
auto app = Gtk::Application::create ( argc, argv, "org.gtkmm.test" );
Gtk::Window window;
Gtk::Button btn;
Gtk::Box box(Gtk::ORIENTATION_HORIZONTAL);
W w;
btn.set_label ( "test" );
window.set_default_size ( 200, 200 );
box.pack_start ( btn, false, false, 0 );
box.pack_start ( w, false, false, 0 );
window.add ( box );
btn.show();
box.show();
w.show();
return app->run ( window );
}