Skip to content

Instantly share code, notes, and snippets.

@andlabs
Created June 5, 2016 23:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andlabs/1df2f6b3c7a803c8af0a77b440afbb10 to your computer and use it in GitHub Desktop.
Save andlabs/1df2f6b3c7a803c8af0a77b440afbb10 to your computer and use it in GitHub Desktop.
struct myPopover {
GtkWidget *popover;
GtkWidget *searchEntry;
GMenuModel *items;
};
struct myPopover *newPopover(void)
{
struct myPopover *p;
p = g_new0(struct myPopover, 0);
p->items = getMyModel();
p->popover = gtk_popover_menu_new_with_model(p->items);
p->searchEntry = gtk_search_entry_new();
// pack the search entry in here
g_signal_connect(p->searchEntry, "changed", G_CALLBACK(search), p);
// ...
return p;
}
static void search(GtkSearchEntry *e, gpointer data)
{
struct myPopover *p = (struct myPopover *) data;
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment