6

Trying to create the framework for a calculator.

I add the window I add the vbox using 2 boxes. 1 for the display, the other for the buttons When I add 1 button it fills the entire panel and I can't resize it.

In visual basic you can just add a button and resize it, or drag and drop anywhere you want.

I just can't figure out how to do it here. Steep learning curve for me.

aquaherd
  • 6,345

2 Answers2

3

GTK+ uses box-based sizing, just like CSS and other modern tools. Also, a VBox will have all its children oriented vertically. You won't be able to add anything to the right.

You can use the GtkLayout for absolute positioning, or a GtkGrid to create a grid-based layout (which is appropriate for calculator).

dobey
  • 41,650
1

You have two options:

  1. In the lower vbox pane, add a 'Grid' container. Your buttons will have all the same size and scale automatically with the window. There, you can increase the gaps between them by playing with the padding and border properties.
  2. Alternatively, add a 'Fixed' container. This will have the same behaviour as in visual basic, but it is not the gtk way.
aquaherd
  • 6,345