summaryrefslogtreecommitdiff
path: root/tests/testtoolbar2.c
blob: 82f8918e3d96cd5d03a8fac2a3e83c4eb2905173 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <gtk/gtk.h>

int main (int argc, char *argv[])
{
  GtkWidget *window;
  GtkWidget *box;
  GtkWidget *frame;
  GtkWidget *box3;
  GtkWidget *view;
  GtkWidget *button;

  gtk_init ();

  window = gtk_window_new ();
  gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
  box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
  gtk_container_add (GTK_CONTAINER (window), box);
  frame = gtk_frame_new (NULL);
  gtk_container_add (GTK_CONTAINER (box), frame);
  view = gtk_text_view_new ();
  gtk_widget_set_vexpand (view, TRUE);
  gtk_container_add (GTK_CONTAINER (box), view);
  box3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
  gtk_widget_set_margin_start (box3, 10);
  gtk_widget_set_margin_end (box3, 10);
  gtk_widget_set_margin_top (box3, 10);
  gtk_widget_set_margin_bottom (box3, 10);

  gtk_widget_add_css_class (box3, GTK_STYLE_CLASS_LINKED);
  button = gtk_button_new_from_icon_name ("document-new-symbolic");
  gtk_container_add (GTK_CONTAINER (box3), button);
  button = gtk_button_new_from_icon_name ("document-open-symbolic");
  gtk_container_add (GTK_CONTAINER (box3), button);
  button = gtk_button_new_from_icon_name ("document-save-symbolic");
  gtk_container_add (GTK_CONTAINER (box3), button);

  gtk_frame_set_child (GTK_FRAME (frame), box3);
  
  gtk_widget_show (GTK_WIDGET (window));

  while (TRUE)
    g_main_context_iteration (NULL, TRUE);

  return 0;
}