Example #1
0
        public static void Main(string[] args)
        {
            Application.Init();
            icon            = StatusIcon.NewFromStock(Stock.ZoomIn);
            icon.Visible    = true;
            icon.Tooltip    = "Task Tracker";
            icon.PopupMenu += OnStatusIconPopupMenu;
            icon.Activate  += MenuViewTaskActivated;
            TaskSettings settings = new TaskSettings();

            settings       = settings.Load();
            watch          = new Timer(settings.interval);
            watch.Elapsed += HandleWatchElapsed;
            watch.Start();
            RequestWork.DisplayMessage();
            Application.Run();
        }
    /// <summary>
    /// Sets up interface.
    /// </summary>
    protected void SetUpInterface()
    {
        // Set up TreeView
        this.tvResults.AppendColumn("Status", new CellRendererText(), "text", 0);
        this.tvResults.AppendColumn("Timestamp", new CellRendererText(), "text", 1);

        // Set Up TreeStore
        TreeStore resultListStore = new TreeStore(typeof(string), typeof(string));

        resultListStore.SetSortFunc(0, CompareURLs);
        resultListStore.SetSortColumnId(0, SortType.Ascending);

        // Bind the TreeStore to the TreeView
        this.tvResults.Model = resultListStore;

        // Create a Bold and Red TextTag
        TextTag tagBold = new TextTag("bold");

        tagBold.Weight     = Pango.Weight.Bold;
        tagBold.Foreground = "red";
        // Add the TextTag to the TextView
        this.txtURLs.Buffer.TagTable.Add(tagBold);

        // Creation of the StatusIcon
        trayIcon         = StatusIcon.NewFromStock(Stock.DialogQuestion);
        trayIcon.Visible = true;

        // Show/Hide the window (even from the Panel/Taskbar) when the TrayIcon has been clicked.
        trayIcon.Activate += delegate {
            this.Visible = !this.Visible;
        };
        // Show a pop up menu when the icon has been right clicked.
        //trayIcon.PopupMenu += OnTrayIconPopup;

        // A Tooltip for the Icon
        trayIcon.Tooltip = "Website Checker";

        // Loader icon
        Gdk.PixbufAnimation pba = Gdk.PixbufAnimation.LoadFromResource("WebsiteChecker.ajax-loader.gif");
        this.imgLoading.PixbufAnimation = pba;

        this.tvResults.Model.RowInserted += HandleTvResultsModelhandleRowInserted;
    }
Example #3
0
 protected virtual void CreateTrayInstance()
 {
     // Sometimes the tray icon will not display
     // if it is not created with an icon
     m_trayIcon = StatusIcon.NewFromStock(Stock.About);
 }