예제 #1
0
void
gnc_entry_ledger_display_init (GncEntryLedger *ledger)
{
    if (!ledger) return;

    ledger->full_refresh = TRUE;
    ledger->component_id = gnc_register_gui_component (ENTRYLEDGER_CLASS,
                           refresh_handler,
                           NULL, ledger);
    gnc_gconf_general_register_cb(KEY_ACCOUNT_SEPARATOR,
                                  gnc_entry_ledger_gconf_changed, ledger);

    gnc_entry_ledger_display_refresh (ledger);
}
static GtkWidget *
gnc_plugin_page_invoice_create_widget (GncPluginPage *plugin_page)
{
    GncPluginPageInvoice *page;
    GncPluginPageInvoicePrivate *priv;
    GtkWidget *regWidget, *widget;

    ENTER("page %p", plugin_page);
    page = GNC_PLUGIN_PAGE_INVOICE (plugin_page);
    priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(page);
    if (priv->widget != NULL)
    {
        LEAVE("");
        return priv->widget;
    }

    priv->widget = gtk_vbox_new (FALSE, 0);
    gtk_widget_show (priv->widget);

    widget = gnc_invoice_create_page(priv->iw, page);
    gtk_widget_show (widget);
    gtk_box_pack_start(GTK_BOX (priv->widget), widget, TRUE, TRUE, 0);

    plugin_page->summarybar = gnc_invoice_window_create_summary_bar(priv->iw);
    gtk_box_pack_start(GTK_BOX (priv->widget), plugin_page->summarybar, FALSE, FALSE, 0);
    gnc_plugin_page_invoice_summarybar_position_changed(NULL, page);
    gnc_gconf_general_register_cb(KEY_SUMMARYBAR_POSITION,
                                  gnc_plugin_page_invoice_summarybar_position_changed, page);

    regWidget = gnc_invoice_get_register(priv->iw);
    if (regWidget)
    {
        g_signal_connect (G_OBJECT (regWidget), "redraw-help",
                          G_CALLBACK (gnc_plugin_page_redraw_help_cb), page);
    }

    priv->component_manager_id =
        gnc_register_gui_component(GNC_PLUGIN_PAGE_INVOICE_NAME,
                                   gnc_plugin_page_invoice_refresh_cb,
                                   NULL, page);

    LEAVE("");
    return priv->widget;
}