title: How do I put a GTKScrolledWindow inside of another container?
body: <p>I want to have a scrollable <code>GtkTextView</code> in my <code>GtkWindow</code>, but I only want the <code>GtkTextView</code> part to scroll instead of the whole window. I tried to put the <code>GTKTextView</code> inside of a <code>GtkScrolledWindow</code> and put the <code>GtkScrolledWindow</code> inside of a <code>GtkFixed</code> container, but then the <code>GtkTextView</code> doesn't show up. When I put the <code>GtkTextView</code> directly inside the <code>GtkFixed</code> container, though, it shows up.</p>
  
  <pre><code>#include &lt;gtk/gtk.h&gt;
  
  GtkWidget *window, *scrolled_window, *fixed, *log_box, *button1;
  GtkTextBuffer *log_box_buffer;
  
  static void button1_clicked(GtkWidget *widget, gpointer data) {
      printf("button1_clicked\n");
      gtk_text_buffer_insert_at_cursor(log_box_buffer, "You clicked the button.\n", 24);
  }
  
  static void app_activate(GtkApplication *app, gpointer user_data) {
  
      window = gtk_application_window_new(app);
      gtk_window_set_title(GTK_WINDOW(window), "Window Title Here");
      gtk_window_set_default_size(GTK_WINDOW(window), 700, 400);
      gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
  
      scrolled_window = gtk_scrolled_window_new(NULL, NULL);
  
      fixed = gtk_fixed_new();
  
      button1 = gtk_button_new_with_label("Button 1");
      g_signal_connect(button1, "clicked", G_CALLBACK(button1_clicked), NULL);
  
      log_box_buffer = gtk_text_buffer_new(NULL);
      log_box = gtk_text_view_new_with_buffer(log_box_buffer);
  
      gtk_fixed_put(GTK_FIXED(fixed), button1, 50, 50);
  
  
      /* Here I tried to put the textview inside of the scrolled window and
         add the scrolled window to the fixed container. The textview
         doesn't show up when I do this. */
  
      gtk_container_add(GTK_CONTAINER(scrolled_window), log_box);
      gtk_fixed_put(GTK_FIXED(fixed), scrolled_window, 200, 50);
  
  
      /* I also tried putting the textview directly in the fixed container.
         This shows up, but obviously I can't scroll it. */
  
  //  gtk_fixed_put(GTK_FIXED(fixed), log_box, 200, 50);
  
  
      gtk_container_add(GTK_CONTAINER(window), fixed);
      gtk_widget_show_all(window);
  }
  
  int main(int argc, char **argv) {
  
      GtkApplication *app;
      int status;
  
      app = gtk_application_new("the.application.id", G_APPLICATION_FLAGS_NONE);
      g_signal_connect(app, "activate", G_CALLBACK(app_activate), NULL);
  
      status = g_application_run(G_APPLICATION(app), argc, argv);
  
      g_object_unref(app);
      return status;
  }
  </code></pre>