RE: How center a small button horizontally like in this picture....



>use a GtkAlignment with xalign and yalign set to 0.5.


or you can simply use a GtkFixed instead, in which you define the exact position
of the Widget:

GtkWidget *button = gtk_button_new_with_label("Hello");
gtk_widget_set_usize(button, 80, 25);
gtk_widget_show(button);

GtkWidget *fixed = gtk_fixed_new();

gtk_fixed_put(GTK_FIXED(fixed), 40, 40); // puts the button on x, y = 40.

gtk_widget_show(fixed);


Afonso



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]