Guest User

Untitled

a guest
Sep 6th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Vala 0.84 KB | None | 0 0
  1. using GLib;
  2. using Gtk;
  3. using Cc;
  4.  
  5. public class MapTesting : Object {
  6.    
  7.     Gtk.Window window;
  8.     Cc.TimezoneMap map;
  9.    
  10.     public bool location_changed(TimezoneLocation data) {
  11.         map.set_watermark(data.Comment);
  12.         return true;
  13.     }
  14.    
  15.     public MapTesting() {
  16.         window = new Window(WindowType.TOPLEVEL);
  17.            
  18.         window.title = "Vala + TimezoneMap";
  19.         window.set_default_size(640, 480);
  20.         window.destroy.connect(Gtk.main_quit);
  21.     map = new TimezoneMap();
  22.     map.set_timezone("America/New_York");
  23.     map.set_watermark("America/New_York");
  24.     map.location_changed.connect((w,tz) => location_changed(tz));
  25.        
  26.         window.add(map);
  27.         window.show_all();
  28.     }
  29.    
  30.     public static int main(string[] args) {
  31.         Gtk.init(ref args);
  32.     var map = new MapTesting();
  33.        
  34.         Gtk.main();
  35.         return 0;
  36.     }
  37. }
Add Comment
Please, Sign In to add comment