Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Vala 1.18 KB | None | 0 0
  1. public static int main (string[] args) {
  2.  
  3.     //---------------------
  4.         // COMPILE WITH: valac --pkg clutter-gtk-1.0 --pkg gtk+-3.0 test.vala
  5.         //---------------------
  6.         // Problem: The whole window should be red!
  7.         //-------
  8.  
  9.         GtkClutter.init (ref args);
  10.         Gtk.Settings.get_default().gtk_application_prefer_dark_theme = true;
  11.        
  12.     Gtk.Window window;
  13.     GtkClutter.Embed embed;
  14.     Clutter.Stage stage;
  15.     Gdk.RGBA color = {1.0, 0.0, 0.0, 1.0}; /* 100% opaque red */
  16.         Gdk.RGBA transparent = {0.0, 1.0, 0.0, 0.5}; /* 100% transparent green */
  17.         Clutter.Color c_color = {255, 255, 255, 0}; /* 100% transparent white*/
  18.  
  19.         window = new Gtk.Window();
  20.         embed = new GtkClutter.Embed();
  21.         embed.margin_top = 50;
  22.         window.add(embed);
  23.         window.set_default_size (250, 250);
  24.  
  25.         stage = embed.get_stage () as Clutter.Stage;
  26.         stage.use_alpha = true;
  27.         stage.background_color = c_color;
  28.        
  29.         window.override_background_color(Gtk.StateFlags.NORMAL, color);
  30.         embed.override_background_color(Gtk.StateFlags.NORMAL, transparent);
  31.         window.show_all();
  32.        
  33.     Gtk.main ();
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement