summaryrefslogtreecommitdiff
path: root/plugins/gtk+/glade-gtk-model-button.c
blob: 5aac1270909e7bb69465cb95fde60cee21aa8960 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <config.h>
#include <glib/gi18n-lib.h>
#include <gladeui/glade.h>
#include "glade-gtk.h"

#include "glade-model-button-editor.h"

static void
model_button_clicked (GtkWidget *widget, gpointer user_data)
{
  GtkWidget *popover;

  popover = gtk_widget_get_ancestor (widget, GTK_TYPE_POPOVER);
  if (popover != NULL)
    gtk_widget_show (popover);
}

void
glade_gtk_model_button_post_create (GladeWidgetAdaptor *adaptor,
                                    GObject            *object,
                                    GladeCreateReason   reason)
{
  g_signal_connect (object, "clicked",
                    G_CALLBACK (model_button_clicked), NULL);
}

void
glade_gtk_model_button_read_widget (GladeWidgetAdaptor *adaptor,
                                    GladeWidget        *widget,
                                    GladeXmlNode       *node)
{
  GWA_GET_CLASS (GTK_TYPE_CONTAINER)->read_widget (adaptor, widget, node);
}

void
glade_gtk_model_button_write_widget (GladeWidgetAdaptor *adaptor,
                                     GladeWidget        *widget,
                                     GladeXmlContext    *context,
                                     GladeXmlNode       *node)
{
  GWA_GET_CLASS (GTK_TYPE_CONTAINER)->write_widget (adaptor, widget, context, node);
}

GladeEditable *
glade_gtk_model_button_create_editable (GladeWidgetAdaptor *adaptor,
                                        GladeEditorPageType type)
{
  if (type == GLADE_PAGE_GENERAL)
    return (GladeEditable *) glade_model_button_editor_new ();
  else
    return GWA_GET_CLASS (GTK_TYPE_CONTAINER)->create_editable (adaptor, type);
}