Reputation: 1051
I am using C GTK+3, using Glade for the GUI design. I have a GtkGrid with 1 row and 3 columns. I have a button on column 2 and I want to add a spacer in column 1 and 3 so the button stays in the middle of the window. Which GTK3 widget should I use to act as a simple 'spacer'?
Upvotes: 2
Views: 2072
Reputation: 637
From your description I'm assuming your interface looks like so:
I think your trying to achieve an interface like so:
Which can be achieved by changing the alignment from fill to centre in the 'Common' tab:
However if you wanted the button to be centred regardless of any content placed in Col 1 / 3 you would be better off with a GtkBox with a center widget:
Which is achieved like so:
Add a horizontally orientated GtkBox and enable center child
Add your button to the extra placeholder displayed
Set any content you want to the right of the button as pack end
Upvotes: 7