MainWindow is a structure. When you call main_window_create(), you have a pointer called main_window. However, it points to nothing until you initialize it! So, when you try to reference main_window->window, it is trying to reference unallocated memory. Therefore, before you can use the structure, you must call:
MainWindow *main_window = g_slice_new (MainWindow);
This will allocate memory for a new MainWindow structure and point main_window to it. If you get a seg fault, it usually means that you are trying to access memory that doesn't exist (unallocated), or you are trying to access memory that was already freed.