int tabmanagergui_create_page (GuTabContext* tc, GuEditor* editor) { GuTabPage* tp = g_new0(GuTabPage, 1); tc->page = tp; int pos; tp->scrollw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(tp->scrollw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gchar* labeltext = tabmanager_get_tabname (tc); tabmanagergui_create_label (tp, labeltext); g_signal_connect (tp->button, "clicked", G_CALLBACK (on_menu_close_activate), tc); tabmanagergui_create_infobar (tp); gtk_container_add (GTK_CONTAINER (tp->scrollw), GTK_WIDGET (editor->view)); tp->editorbox = gtk_vbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (tp->editorbox), tp->infobar, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (tp->editorbox), tp->scrollw, TRUE, TRUE, 0); pos = gtk_notebook_append_page (GTK_NOTEBOOK (g_tabnotebook), tp->editorbox, GTK_WIDGET (tp->labelbox)); gtk_widget_show_all (tp->editorbox); return pos; }
void gui_set_filename_display(GuTabContext* tc, gboolean title, gboolean label) { gchar* filetext = tabmanager_get_tabname(tc); if (label) tabmanagergui_update_label(tc->page, filetext); if (title) gui_set_window_title(tc->editor->filename, filetext); }