~ubuntu-branches/ubuntu/vivid/alarm-clock-applet/vivid

« back to all changes in this revision

Viewing changes to src/tests/glade_view.c

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2010-03-17 09:02:44 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100317090244-ni0ye04mva2hxe10
Tags: 0.3.0-1
* New upstream release
* debian/control:
  + No change bump of Standards-Version to 3.8.4
  + Update build-deps:
    - Drop libglade, libpanel-applet, libgnomevfs2, libgnome{2,ui}
    - Add libxml2-dev and libunique-dev, intltool
* debian/patches/01_update-alarms-eta,patch:
  + Dropped, applied upstream
* debian/(alarm-clock-applet.1, alarm-clock-applet.manpages):
  + Add manpage for alarm-clock-applet, now that the binary is moved to
    /usr/bin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * glade_view.c -- Test utility for running a glade file.
3
 
 * 
4
 
 * Copyright (C) 2007-2008 Johannes H. Jensen <joh@pseudoberries.com>
5
 
 * 
6
 
 * This program is free software; you can redistribute it and/or
7
 
 * modify it under the terms of the GNU General Public License
8
 
 * as published by the Free Software Foundation; either version 2
9
 
 * of the License, or (at your option) any later version.
10
 
 *
11
 
 * This program is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 * GNU General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program; if not, write to the Free Software
18
 
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19
 
 * 
20
 
 * Authors:
21
 
 *              Johannes H. Jensen <joh@pseudoberries.com>
22
 
 */
23
 
 
24
 
#include <gtk/gtk.h>
25
 
#include <glade/glade.h>
26
 
 
27
 
int main (int argc, char **argv)
28
 
{
29
 
        gchar *file, *root = NULL;
30
 
        GladeXML *ui;
31
 
        
32
 
        gtk_init (&argc, &argv);
33
 
        
34
 
        if (argc < 2) {
35
 
                g_printerr ("Usage: %s <glade-file> [root]\n", argv[0]);
36
 
                return 1;
37
 
        }
38
 
        
39
 
        file = argv[1];
40
 
        if (argc > 2)
41
 
                root = argv[2];
42
 
        
43
 
        ui = glade_xml_new (file, root, NULL);
44
 
        
45
 
        if (!ui) {
46
 
                g_printerr ("Could not open '%s'. Exiting.\n", file);
47
 
                return 1;
48
 
        }
49
 
        
50
 
        GtkWidget *checkbox = glade_xml_get_widget(ui, "snooze-check");
51
 
        /* you can't do this from glade */
52
 
        GtkWidget *checkbox_label = gtk_bin_get_child (GTK_BIN (checkbox));
53
 
        g_object_set (G_OBJECT (checkbox_label), "use_markup", TRUE, NULL);
54
 
        
55
 
        gtk_main();
56
 
        
57
 
        return 0;
58
 
}