ocarina: Added filter entry
This commit is contained in:
parent
1c0084b2e9
commit
048313c681
|
@ -0,0 +1,25 @@
|
|||
|
||||
#include <libsaria/library.h>
|
||||
#include <libsaria/print.h>
|
||||
#include "header.h"
|
||||
|
||||
static GtkWidget *entry = NULL;
|
||||
|
||||
static void do_filter(GtkWidget *entry)
|
||||
{
|
||||
string text = gtk_entry_get_text(GTK_ENTRY(entry));
|
||||
libsaria::library::filter(text);
|
||||
}
|
||||
|
||||
static void make_entry()
|
||||
{
|
||||
entry = gtk_entry_new();
|
||||
GTK_CONNECT(entry, "changed", do_filter, NULL);
|
||||
}
|
||||
|
||||
GtkWidget *get_entry()
|
||||
{
|
||||
if (entry == NULL)
|
||||
make_entry();
|
||||
return entry;
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef OCARINA_HEADER_PRIVATE_H
|
||||
#define OCARINA_HEADER_PRIVATE_H
|
||||
|
||||
#include <ocarina/header.h>
|
||||
|
||||
GtkWidget *get_entry();
|
||||
|
||||
#endif /* OCARINA_HEADER_PRIVATE_H */
|
Loading…
Reference in New Issue