~bcurtiswx/ubuntu/precise/empathy/3.4.2.1-0ubuntu1

« back to all changes in this revision

Viewing changes to tests/interactive/contact-manager.c

  • Committer: Bazaar Package Importer
  • Author(s): Laurent Bigonville
  • Date: 2009-11-16 23:40:52 UTC
  • mfrom: (1.1.39 upstream)
  • mto: (6.3.7 experimental)
  • mto: This revision was merged to the branch mainline in revision 80.
  • Revision ID: james.westby@ubuntu.com-20091116234052-7hhwrpeln4mwdyw7
Tags: upstream-2.29.2
ImportĀ upstreamĀ versionĀ 2.29.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdlib.h>
 
2
 
 
3
#include <glib.h>
 
4
#include <gtk/gtk.h>
 
5
#include <libempathy/empathy-contact-manager.h>
 
6
#include <libempathy/empathy-debug.h>
 
7
 
 
8
#include <libempathy-gtk/empathy-contact-list-store.h>
 
9
#include <libempathy-gtk/empathy-ui-utils.h>
 
10
 
 
11
int
 
12
main (int argc, char **argv)
 
13
{
 
14
        EmpathyContactManager *manager;
 
15
        GMainLoop             *main_loop;
 
16
        EmpathyContactListStore *store;
 
17
        GtkWidget *combo;
 
18
        GtkWidget *window;
 
19
        GtkCellRenderer *renderer;
 
20
 
 
21
        gtk_init (&argc, &argv);
 
22
        empathy_gtk_init ();
 
23
 
 
24
        empathy_debug_set_flags (g_getenv ("EMPATHY_DEBUG"));
 
25
        main_loop = g_main_loop_new (NULL, FALSE);
 
26
        manager = empathy_contact_manager_dup_singleton ();
 
27
        store = empathy_contact_list_store_new (EMPATHY_CONTACT_LIST (manager));
 
28
        empathy_contact_list_store_set_is_compact (store, TRUE);
 
29
        empathy_contact_list_store_set_show_groups (store, FALSE);
 
30
        combo = gtk_combo_box_new_with_model (GTK_TREE_MODEL (store));
 
31
        renderer = gtk_cell_renderer_text_new ();
 
32
        gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, TRUE);
 
33
        gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (combo), renderer, "text", EMPATHY_CONTACT_LIST_STORE_COL_NAME);
 
34
        window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 
35
        gtk_container_add (GTK_CONTAINER (window), combo);
 
36
        gtk_widget_show (combo);
 
37
        gtk_widget_show (window);
 
38
        g_object_unref (manager);
 
39
 
 
40
        gtk_main ();
 
41
 
 
42
        return EXIT_SUCCESS;
 
43
}
 
44