Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > 6c1a1d2d0e9b9232d76ec7c9f0bced2e > files > 193

libdazzle-devel-3.32.2-1.mga7.armv7hl.rpm

#!/usr/bin/env gjs

imports.gi.versions["Gdk"] = "3.0"
imports.gi.versions["Gtk"] = "3.0"

const GLib = imports.gi.GLib;
const Gdk = imports.gi.Gdk;
const Gtk = imports.gi.Gtk;
const Dazzle = imports.gi.Dazzle;

Gtk.init(null);

/*
 * NOTE: If you are using Dazzle.Application as your base GApplication,
 *       then the following theme loading is handled for you. You need
 *       not manually register CSS.
 */
Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(),
                                         Dazzle.CssProvider.new ("resource:///org/gnome/dazzle/themes"),
                                         Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);

let win = new Gtk.Window({title: "Cpu Graph"});
let graph = new Dazzle.CpuGraph({timespan: GLib.TIME_SPAN_MINUTE, max_samples: 120});

win.add(graph);
win.connect('delete-event', function(){
  Gtk.main_quit();
});
win.show_all();

Gtk.main();