suggesting gnome_property_box_unchanged(...)



I noticed that the GnomePropertyBox had a gnome_property_box_changed(...)
function, but no inverse operation. This is useful in a case when you close the
dialog (with gnome_dialog_close_hides argument to 1) and want the changes to
disappear, while disabling the apply button, so that you can reopen it with the
old data. Here is gnome_property_box_unchanged(...) (only two numbers changed
from its counterpart).

static void
gnome_property_box_unchanged (GnomePropertyBox *property_box)
{
        GtkWidget *page;

        g_return_if_fail (property_box != NULL);
        g_return_if_fail (GNOME_IS_PROPERTY_BOX (property_box));
        g_return_if_fail (property_box->notebook);
        g_return_if_fail (GTK_NOTEBOOK (property_box->notebook)->cur_page);
        
        page = GTK_NOTEBOOK (property_box->notebook)->cur_page->child;
        g_assert (page != NULL);
        
        gtk_object_set_data(GTK_OBJECT(page),
                            GNOME_PROPERTY_BOX_DIRTY,
                            GINT_TO_POINTER(0));

        set_sensitive (property_box, 0);
}

	Jean-Marc Valin




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]