/* * zavai-calendar - simple calendar tool * * Copyright (C) 2009 Enrico Zini * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ using GLib; //string VERSION = "0.1"; static int main (string[] args) { string opt_popup = null; GLib.OptionEntry[] entries = new GLib.OptionEntry[] { OptionEntry() { long_name = "popup", short_name = 'p', flags = 0, arg = OptionArg.STRING, arg_data = &opt_popup, description = "run as a popup at the specified location on screen", arg_description = "X,Y" }, OptionEntry() }; Gtk.init_with_args(ref args, "", entries, null); // parser = Parser(usage="usage: %prog [options]", // version="%prog "+ VERSION, // description="Simple interactive interface for the OpenMoko") // parser.add_option("-v", "--verbose", action="store_true", help="verbose mode") // // (opts, args) = parser.parse_args() // // if not opts.verbose: // zavai.set_quiet() // // # Read configuration // zavai.info("Loading configuration") // conf = zavai.Config() // Set up zavai // Core infrastructure zavai.config = new zavai.Config(); // User interface var calendar = new zavai.widgets.Calendar(); Gtk.WindowType wtype; if (opt_popup == null) wtype = Gtk.WindowType.TOPLEVEL; else { wtype = Gtk.WindowType.POPUP; } var win = new Gtk.Window(wtype); win.title = "Zavai calendar"; win.destroy += Gtk.main_quit; win.add(calendar); win.set_size_request(300, 500); win.show_all(); win.show(); // # Shutdown the main loop on SIGINT // def on_kill(signum, frame): // gtk.main_quit() // signal.signal(signal.SIGINT, on_kill) // signal.signal(signal.SIGTERM, on_kill) Gtk.main(); // zavai.info("Shutting down") //zavai.registry.shutdown(); return 0; }