コード例 #1
0
ファイル: gtk-run.c プロジェクト: bookwar/lxpanel
static void setup_auto_complete_with_data(ThreadData* data)
{
    GtkListStore* store;
    GSList *l;
    GtkEntryCompletion* comp = gtk_entry_completion_new();
    gtk_entry_completion_set_minimum_key_length( comp, 2 );
    gtk_entry_completion_set_inline_completion( comp, TRUE );
#if GTK_CHECK_VERSION( 2, 8, 0 )
    gtk_entry_completion_set_popup_set_width( comp, TRUE );
    gtk_entry_completion_set_popup_single_match( comp, FALSE );
#endif
    store = gtk_list_store_new( 1, G_TYPE_STRING );

    for( l = data->files; l; l = l->next )
    {
        const char *name = (const char*)l->data;
        GtkTreeIter it;
        gtk_list_store_append( store, &it );
        gtk_list_store_set( store, &it, 0, name, -1 );
    }

    gtk_entry_completion_set_model( comp, (GtkTreeModel*)store );
    g_object_unref( store );
    gtk_entry_completion_set_text_column( comp, 0 );
    gtk_entry_set_completion( (GtkEntry*)data->entry, comp );

    /* trigger entry completion */
    gtk_entry_completion_complete(comp);
    g_object_unref( comp );
}
コード例 #2
0
static void
on_changed( GtkEntry* entry, gpointer user_data )
{
    GtkEntryCompletion* completion;
    completion = gtk_entry_get_completion( entry );
    update_completion( entry, completion );
    gtk_entry_completion_complete( gtk_entry_get_completion(GTK_ENTRY(entry)) );
    seek_path_delayed( GTK_ENTRY( entry ), 0 );
}
コード例 #3
0
ファイル: entrycompletion.c プロジェクト: amery/clip-angelo
int
clip_GTK_ENTRYCOMPLETIONCOMPLETE(ClipMachine * ClipMachineMemory)
{
   C_object *ccompletion = _fetch_co_arg(ClipMachineMemory);

   CHECKCOBJ(ccompletion, GTK_IS_ENTRY_COMPLETION(ccompletion->object));

   gtk_entry_completion_complete(GTK_ENTRY_COMPLETION(ccompletion->object));

   return 0;
 err:
   return 1;
}
コード例 #4
0
static VALUE
rg_complete(VALUE self)
{
    gtk_entry_completion_complete(_SELF(self));
    return self;
}
コード例 #5
0
 // Really change the completion model (which may be NULL).
 void UseModel(GtkListStore* store)
 {
     GtkEntryCompletion* const c = gtk_entry_get_completion(m_widgetEntry);
     gtk_entry_completion_set_model (c, GTK_TREE_MODEL(store));
     gtk_entry_completion_complete (c);
 }