コード例 #1
0
    // // // // // // // // // // // // // // // // // // // // // // // // // // // //
    // MAIN CONSTRUCTOR																 //
    // // // // // // // // // // // // // // // // // // // // // // // // // // // //
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        // Build window
        Build();

        // Start internet connectivity periodic check
        Connection.StartCheck();

        // drawing framework setup
        // Input 1: Coloumns
        // Input 2: Rows
        // Input 3: Swipe Times
        DrawAssembly.Setup(4, 3, 1);

        // Create space for max widgets
        WidgetContainer.AssignWidgetSpace(MAX_WIDGETS);

        // Instantiate widgets from widget construct
        WidgetConstruct.ConstructWidgets();


        // initiate user settings
        UserSettings.Initiate();

        // starts data gathering
        CurrentData.StartDataGathering();


        GraphContainer.CreateGraphs();

        // Setup main update timer
        MainUpdate           = new Timer(10);
        MainUpdate.Elapsed  += new ElapsedEventHandler(OnUpdate);
        MainUpdate.Enabled   = true;
        MainUpdate.AutoReset = true;

        // Setup events
        mainDrawingArea.ButtonPressEvent += new ButtonPressEventHandler(HandlePress);
        mainDrawingArea.AddEvents((int)EventMask.AllEventsMask);
    }
コード例 #2
0
 // // // // // // // // // // // // // // // // // // // // // // // // // // // //
 // WIDGET DRAING AREA EXPOSE EVENT												 //
 // // // // // // // // // // // // // // // // // // // // // // // // // // // //
 protected void OnMainDrawingAreaExposeEvent(object o, ExposeEventArgs args)
 {
     DrawAssembly.UpdateDrawingContext(mainDrawingArea.GdkWindow, this.Allocation.Width, this.Allocation.Height);
     DrawAssembly.DrawBackground(UserSettings.BgColorR, UserSettings.BgColorG, UserSettings.BgColorB);
     DrawAssembly.DrawFramework();
 }