|
@@ -24,25 +24,43 @@
|
|
|
|
|
|
|
|
struct _OupisWindow
|
|
struct _OupisWindow
|
|
|
{
|
|
{
|
|
|
- AdwApplicationWindow parent_instance;
|
|
|
|
|
|
|
+ AdwApplicationWindow parent_instance;
|
|
|
|
|
|
|
|
- /* Template widgets */
|
|
|
|
|
- GtkLabel *label;
|
|
|
|
|
|
|
+ /* Template widgets */
|
|
|
|
|
+ GtkSearchEntry *searchentry;
|
|
|
|
|
+ GtkLabel *label;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
G_DEFINE_FINAL_TYPE (OupisWindow, oupis_window, ADW_TYPE_APPLICATION_WINDOW)
|
|
G_DEFINE_FINAL_TYPE (OupisWindow, oupis_window, ADW_TYPE_APPLICATION_WINDOW)
|
|
|
|
|
|
|
|
static void
|
|
static void
|
|
|
-oupis_window_class_init (OupisWindowClass *klass)
|
|
|
|
|
|
|
+oupis_window__search_request (GtkSearchEntry *self,
|
|
|
|
|
+ gpointer userdata)
|
|
|
{
|
|
{
|
|
|
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
|
|
|
|
|
|
+ char* request;
|
|
|
|
|
+ request = gtk_editable_get_text (GTK_EDITABLE (self));
|
|
|
|
|
+ g_print ("%s\n", request);
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- gtk_widget_class_set_template_from_resource (widget_class, "/lu/arnoux/Oupis/oupis-window.ui");
|
|
|
|
|
- gtk_widget_class_bind_template_child (widget_class, OupisWindow, label);
|
|
|
|
|
|
|
+static void
|
|
|
|
|
+oupis_window_class_init (OupisWindowClass *klass)
|
|
|
|
|
+ {
|
|
|
|
|
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
|
|
|
|
+
|
|
|
|
|
+ gtk_widget_class_set_template_from_resource (widget_class, "/lu/arnoux/Oupis/oupis-window.ui");
|
|
|
|
|
+ gtk_widget_class_bind_template_child (widget_class, OupisWindow, searchentry);
|
|
|
|
|
+ gtk_widget_class_bind_template_child (widget_class, OupisWindow, label);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
static void
|
|
|
oupis_window_init (OupisWindow *self)
|
|
oupis_window_init (OupisWindow *self)
|
|
|
{
|
|
{
|
|
|
- gtk_widget_init_template (GTK_WIDGET (self));
|
|
|
|
|
|
|
+ gtk_widget_init_template (GTK_WIDGET (self) );
|
|
|
|
|
+
|
|
|
|
|
+ GtkSearchEntry *searchentry = GTK_SEARCH_ENTRY (self->searchentry);
|
|
|
|
|
+ g_signal_connect (searchentry,
|
|
|
|
|
+ "activate",
|
|
|
|
|
+ G_CALLBACK (oupis_window__search_request),
|
|
|
|
|
+ self);
|
|
|
|
|
+
|
|
|
}
|
|
}
|