Anordnung von GUI-Elementen:
https://www.proggen.org/doku.php?id=gui:gtk:boxes
Einsatz von GTK Boxen:
Code: Alles auswählen
#include <gtk/gtk.h>
int main(int argc, char** argv)
{
GtkWidget *window;
GtkWidget *vbox;
gtk_init(&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
vbox = gtk_vbox_new(FALSE, 0);
gtk_container_add(GTK_CONTAINER(window), vbox);
gtk_box_pack_start(GTK_BOX(vbox), gtk_label_new("Element 1"), FALSE, FALSE, 0);
gtk_box_pack_end(GTK_BOX(vbox), gtk_label_new("Element 2"), FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox), gtk_label_new("Element 3"), FALSE, FALSE, 0);
g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
gtk_widget_show_all(window);
gtk_main();
return 0;
}
Code: Alles auswählen
vbox = gtk_vbox_new(0, FALSE);
Liebe Grüße
von Xeon