ocarina: Added filter entry

This commit is contained in:
Bryan Schumaker 2011-11-13 10:49:05 -05:00
parent 1c0084b2e9
commit 048313c681
2 changed files with 33 additions and 0 deletions

25
ocarina/header/entry.cpp Normal file
View File

@ -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;
}

8
ocarina/header/header.h Normal file
View File

@ -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 */