/gpump/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/gpump/trunk

« back to all changes in this revision

Viewing changes to src/test_user_button.js

  • Committer: Gustav Hartvigsson
  • Date: 2014-12-02 21:00:08 UTC
  • mfrom: (52.1.12 GPump_test)
  • Revision ID: gustav.hartvigsson@gmail.com-20141202210008-v9ma32lgz57i0ikb
* Made the window behave when it is shown

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
imports.searchPath.unshift('.', './src/');
 
2
 
 
3
const UserButton = imports.user_button;
 
4
const Gtk = imports.gi.Gtk;
 
5
 
 
6
const Lang = imports.lang;
 
7
 
 
8
function main (argv) {
 
9
  print ("hello");
 
10
  Gtk.init (null, null);
 
11
  
 
12
  print ("world");
 
13
  var win = new Gtk.Window ();
 
14
  
 
15
  var usr_btn = new UserButton.UserButton ({}/*{
 
16
    user_avatar: Gtk.Image.new_from_icon_name ("avatar-default", null),
 
17
    user_name: "Jonee Doee"
 
18
  }*/);
 
19
  
 
20
  print ("and");
 
21
  win.add (usr_btn);
 
22
  
 
23
  usr_btn.set_property ("user_avatar", Gtk.Image.new_from_icon_name ("avatar-default", null));
 
24
  
 
25
  usr_btn.connect ("clicked", Lang.bind (usr_btn, function () {
 
26
    usr_btn.set_property ("show_avatar_only", true);
 
27
    print ("Hello, balls!")
 
28
  }));
 
29
  
 
30
  var layout = new Gtk.Box ({orientation: Gtk.Orientation.HORIZONTAL});
 
31
  
 
32
  /*
 
33
  var btn = new Gtk.Button ({child: layout, always_show_image: true });
 
34
  
 
35
  layout.add (new Gtk.Label ({label: "Jonee Doee"}));
 
36
  
 
37
  layout.add (Gtk.Image.new_from_icon_name ("avatar-default-symbolic", null));
 
38
  
 
39
  win.add (btn);
 
40
  */
 
41
  print ("more");
 
42
  win.connect ("destroy", function () { Gtk.main_quit () });
 
43
  win.show_all ();
 
44
  Gtk.main ();
 
45
}
 
46
 
 
47
main (ARGV);