Skip to content

Instantly share code, notes, and snippets.

@petabyt
Created August 8, 2021 16:17
Show Gist options
  • Save petabyt/705d7e3a42699a92ddb1c2749b105567 to your computer and use it in GitHub Desktop.
Save petabyt/705d7e3a42699a92ddb1c2749b105567 to your computer and use it in GitHub Desktop.
GTK 3 Tabbed Notebook Example
...
// Set up notebook
GtkWidget *notebook;
notebook = gtk_notebook_new();
gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_TOP);
gtk_container_add(GTK_CONTAINER(window), notebook);
gtk_widget_show(notebook);
GtkWidget *grid = gtk_grid_new();
gtk_container_set_border_width(GTK_CONTAINER(grid), 10);
gtk_widget_show(grid);
// Attach items to the grid
GtkWidget *label = gtk_label_new("Foo bar");
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_CENTER);
gtk_grid_attach(GTK_GRID(grid), label, 0, 0, 1, 1);
gtk_widget_show(label);
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment