Example #1
0
static void sp_button_dispose(GObject *object)
{
    SPButton *button = SP_BUTTON(object);

    if (button->action) {
        sp_button_set_action(button, NULL);
    }
    if (button->doubleclick_action) {
        sp_button_set_doubleclick_action(button, NULL);
    }

    button->c_set_active.~connection();
    button->c_set_sensitive.~connection();

    (G_OBJECT_CLASS(sp_button_parent_class))->dispose(object);
}
Example #2
0
GtkWidget *sp_button_new(Inkscape::IconSize size, SPButtonType type, SPAction *action, SPAction *doubleclick_action)
{
    SPButton *button = SP_BUTTON(g_object_new(SP_TYPE_BUTTON, NULL));

    button->type = type;
    button->lsize = CLAMP(size, Inkscape::ICON_SIZE_MENU, Inkscape::ICON_SIZE_DECORATION);

    sp_button_set_action(button, action);
    if (doubleclick_action)
        sp_button_set_doubleclick_action(button, doubleclick_action);

    // The Inkscape style is no-relief buttons
    gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);

    return GTK_WIDGET(button);
}
Example #3
0
GtkWidget *
sp_button_new( Inkscape::IconSize size, SPButtonType type, SPAction *action, SPAction *doubleclick_action, GtkTooltips *tooltips )
{
	SPButton *button;

	button = (SPButton *)g_object_new (SP_TYPE_BUTTON, NULL);

	button->type = type;
	button->lsize = CLAMP( size, Inkscape::ICON_SIZE_MENU, Inkscape::ICON_SIZE_DECORATION );
	button->tooltips = tooltips;

	if (tooltips) g_object_ref ((GObject *) tooltips);

	sp_button_set_action (button, action);
	if (doubleclick_action)
		sp_button_set_doubleclick_action (button, doubleclick_action);

	// The Inkscape style is no-relief buttons
	gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);

	return (GtkWidget *) button;
}
Example #4
0
static void
sp_button_destroy (GtkObject *object)
{
	SPButton *button;

	button = SP_BUTTON (object);

	if (button->tooltips) {
		g_object_unref (G_OBJECT (button->tooltips));
		button->tooltips = NULL;
	}

	if (button->action) {
		sp_button_set_action (button, NULL);
	}

	if (button->doubleclick_action) {
		sp_button_set_doubleclick_action (button, NULL);
	}

	((GtkObjectClass *) (parent_class))->destroy (object);
}