元々私はpyGtkを学びました。数ヶ月後、私はGtkmmに切り替えることにしました。 oficialドキュメンテーションを読むと、Gtk :: Tableは非難されているので、代わりにGtk :: Gridを使うべきです。
2番目と3番目の行の間、4番目と5番目の列の間にウィジェットを配置したい場合は、このコードをGtk :: Tableで使用します。Gtk :: Gridと同様にGtk :: 3のウィジェットを配置する方法
// Create variable.
Gtk::Table table;
//Initiate table.
table(10,10,true);
//Place the widget in the proper position.
// table.attach(widget, left_attach, right_attach, top_attach, bottom_attach);
table.attach(widget,4,5,2,3);
Gtk :: Gridについて読んだ後、同じことを試みましたが、今回はGtk :: Gridを使用しました。
// Create variable.
Gtk::Grid grid;
//Place the widget in the proper position.
//grid.attach(widget, left, top, higth, width);
grid.attach(widget,4,2,1,1);
最後のコードを試してみると、ウィジェット(ボタン)は左上隅に配置されたままです。私が間違っていることについて誰でも手掛かりがありますか? Gtk :: Gridは私が望むことをする能力を持っていますか?