void anjuta_docman_add_document (AnjutaDocman *docman, IAnjutaDocument *doc, GFile* file) { AnjutaDocmanPage *page; page = anjuta_docman_page_new (); anjuta_docman_page_init (docman, doc, file, page); /* list order matches pages in book, initially at least */ docman->priv->pages = g_list_prepend (docman->priv->pages, (gpointer)page); gtk_notebook_prepend_page_menu (GTK_NOTEBOOK (docman), page->widget, page->box, page->menu_box); gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (docman), page->widget, TRUE); g_signal_connect (G_OBJECT (doc), "update-save-ui", G_CALLBACK (on_document_update_save_ui), docman); g_signal_connect (G_OBJECT (doc), "destroy", G_CALLBACK (on_document_destroy), docman); g_object_ref (doc); anjuta_docman_set_current_document (docman, doc); anjuta_shell_present_widget (docman->shell, GTK_WIDGET (docman->priv->plugin->vbox), NULL); anjuta_docman_update_documents_menu (docman); g_signal_emit_by_name (docman, "document-added", doc); }
/** \brief Description yet to be added. **/ static int addPage ( GtkNotebook *notebook, Tcl_Interp *interp, Tcl_Obj *child, Tcl_Obj *label, Tcl_Obj *menu, int begin ) { GtkWidget *menuWidget; GtkWidget *labelWidget; GtkWidget *childWidget = gnoclChildNotPacked ( Tcl_GetString ( child ), interp ); if ( childWidget == NULL ) return -1; labelWidget = getLabel ( interp, label ); if ( labelWidget == NULL ) return -1; menuWidget = getLabel ( interp, menu ? menu : label ); if ( menuWidget == NULL ) return -1; if ( begin ) gtk_notebook_append_page_menu ( notebook, childWidget, labelWidget, menuWidget ); else gtk_notebook_prepend_page_menu ( notebook, childWidget, labelWidget, menuWidget ); return gtk_notebook_page_num ( notebook, childWidget ); }
/* Prepends to notebook a page whose content is child, whose bookmark * is tab_label, and whose menu label is menu_label. */ int clip_GTK_NOTEBOOKPREPENDPAGEMENU(ClipMachine * ClipMachineMemory) { C_widget *cntb = _fetch_cw_arg(ClipMachineMemory); C_widget *cchild = _fetch_cwidget(ClipMachineMemory, _clip_spar(ClipMachineMemory, 2)); C_widget *ctab_label; GtkWidget *tab_label; C_widget *cmenu_label; GtkWidget *menu_label; CHECKCWID(cntb, GTK_IS_NOTEBOOK); CHECKARG2(2, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType); CHECKCWID(cchild, GTK_IS_WIDGET); CHECKARG3(3, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType, CHARACTER_type_of_ClipVarType); CHECKARG3(4, MAP_type_of_ClipVarType, NUMERIC_type_of_ClipVarType, CHARACTER_type_of_ClipVarType); if (_clip_parinfo(ClipMachineMemory, 3) == CHARACTER_type_of_ClipVarType) { char *caption = _clip_parc(ClipMachineMemory, 3); LOCALE_TO_UTF(caption); tab_label = gtk_label_new(caption); FREE_TEXT(caption); } else { ctab_label = _fetch_cwidget(ClipMachineMemory, _clip_spar(ClipMachineMemory, 3)); CHECKCWID(ctab_label, GTK_IS_WIDGET); if (ctab_label) tab_label = ctab_label->widget; } if (_clip_parinfo(ClipMachineMemory, 4) == CHARACTER_type_of_ClipVarType) { char *menu_text = _clip_parc(ClipMachineMemory, 4); LOCALE_TO_UTF(menu_text); menu_label = gtk_label_new(menu_text); FREE_TEXT(menu_text); } else { cmenu_label = _fetch_cwidget(ClipMachineMemory, _clip_spar(ClipMachineMemory, 4)); CHECKCWID(cmenu_label, GTK_IS_WIDGET); if (cmenu_label) menu_label = cmenu_label->widget; } gtk_notebook_prepend_page_menu(GTK_NOTEBOOK(cntb->widget), cchild->widget, tab_label, menu_label); return 0; err: return 1; }
static VALUE rg_prepend_page_menu(int argc, VALUE *argv, VALUE self) { VALUE child, tab_label, menu_label; rb_scan_args(argc, argv, "12", &child, &tab_label, &menu_label); gtk_notebook_prepend_page_menu(_SELF(self), RVAL2WIDGET(child), RVAL2WIDGET(tab_label), NIL_P(menu_label) ? NULL : RVAL2WIDGET(menu_label)); return self; }