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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include <ctk/ctk.h>

static void
fill_text_view (CtkWidget *tv, const gchar *text)
{
  gint i;
  GString *s;

  s = g_string_new ("");
  for (i = 0; i < 200; i++)
    g_string_append_printf (s, "%s %d\n", text, i);

  ctk_text_buffer_set_text (ctk_text_view_get_buffer (CTK_TEXT_VIEW (tv)),
                            g_string_free (s, FALSE), -1); 
}

int
main (int   argc G_GNUC_UNUSED,
      char *argv[] G_GNUC_UNUSED)<--- There is an unknown macro here somewhere. Configuration is required. If G_GNUC_UNUSED is a macro then please configure it.
{
  CtkWidget *win, *box, *tv, *sw, *sb;
  CtkAdjustment *adj;

  ctk_init (NULL, NULL);

  win = ctk_window_new (CTK_WINDOW_TOPLEVEL);
  ctk_window_set_default_size (CTK_WINDOW (win), 640, 480);

  box = ctk_box_new (CTK_ORIENTATION_HORIZONTAL, 5);
  ctk_container_add (CTK_CONTAINER (win), box);

  sw = ctk_scrolled_window_new (NULL, NULL);
  ctk_scrolled_window_set_policy (CTK_SCROLLED_WINDOW (sw),
                                  CTK_POLICY_NEVER,
                                  CTK_POLICY_EXTERNAL);
  ctk_box_pack_start (CTK_BOX (box), sw, TRUE, TRUE, 0);
  tv = ctk_text_view_new ();
  fill_text_view (tv, "Left");
  ctk_container_add (CTK_CONTAINER (sw), tv);

  adj = ctk_scrolled_window_get_vadjustment (CTK_SCROLLED_WINDOW (sw));

  sw = ctk_scrolled_window_new (NULL, adj);
  ctk_scrolled_window_set_policy (CTK_SCROLLED_WINDOW (sw),
                                  CTK_POLICY_NEVER,
                                  CTK_POLICY_EXTERNAL);
  ctk_box_pack_start (CTK_BOX (box), sw, TRUE, TRUE, 0);
  tv = ctk_text_view_new ();
  fill_text_view (tv, "Middle");
  ctk_container_add (CTK_CONTAINER (sw), tv);

  sw = ctk_scrolled_window_new (NULL, adj);
  ctk_scrolled_window_set_policy (CTK_SCROLLED_WINDOW (sw),
                                  CTK_POLICY_NEVER,
                                  CTK_POLICY_EXTERNAL);
  ctk_box_pack_start (CTK_BOX (box), sw, TRUE, TRUE, 0);
  tv = ctk_text_view_new ();
  fill_text_view (tv, "Right");
  ctk_container_add (CTK_CONTAINER (sw), tv);

  sb = ctk_scrollbar_new (CTK_ORIENTATION_VERTICAL, adj);

  ctk_container_add (CTK_CONTAINER (box), sb);

  ctk_widget_show_all (win);

  ctk_main ();

  return 0;
}