Advertisement
noobtux

main.vala

Mar 10th, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Vala 1.53 KB | None | 0 0
  1. using Gtk;
  2.  
  3. namespace GraniteHello {
  4.  
  5.     public class GraniteHello : Granite.Application {
  6.  
  7.         public Window m_window;
  8.        
  9.         construct {
  10.             program_name = "GraniteHello";
  11.             exec_name = "granitehello";
  12.             app_years = "2013";
  13.             app_icon = "application-default-icon";
  14.             app_launcher = "granite_hello.desktop";
  15.             application_id = "org.elementary.granitehello";
  16.             main_url = "http://www.ejweb.com.br/";
  17.             bug_url = "http://www.ejweb.com.br/bugs/";
  18.             help_url = "http://www.ejweb.com.br/help/";
  19.             translate_url = "http://www.ejweb.com.br/translate/";
  20.             /* about_authors = {"Your Girl <em>"};
  21.                about_documenters = {"Your <em>"};
  22.                about_artists = {"eu <em@e>"};
  23.                about_comments = {"Edu translator!"};
  24.                about_translators = {"tetss de tra."};
  25.             */
  26.             //also License.GPL_2_0 and License.GPL_3_0
  27.             about_license_type = License.GPL_3_0;
  28.         }
  29.  
  30.         public GraniteHello(){
  31.             // For example if we wanted to use a dark theme.
  32.             // Gtk.Settings.get_default ().gtk_application_prefer_dark_theme = true;
  33.         }
  34.        
  35.         public override void activate (){
  36.             this.m_window = new Window();
  37.             this.m_window.set_default_size(800, 600);
  38.             this.m_window.set_application(this);
  39.             var button = new Button.with_label ("Oh Boy!");
  40.  
  41.             button.clicked.connect(() => {
  42.                 button.label = "Thank you!";
  43.             });
  44.  
  45.             this.m_window.add(button);
  46.             this.m_window.show_all();
  47.         }
  48.     }
  49. }
  50.  
  51. public static int main(string[] args){
  52.  
  53.     Gtk.init(ref args);
  54.     var GraniteHello = new GraniteHello.GraniteHello();
  55.     return GraniteHello.run(args);
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement