Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int main (string[] args) {
- //---------------------
- // COMPILE WITH: valac --pkg clutter-gtk-1.0 --pkg gtk+-3.0 test.vala
- //---------------------
- // Problem: The whole window should be red!
- //-------
- GtkClutter.init (ref args);
- Gtk.Settings.get_default().gtk_application_prefer_dark_theme = true;
- Gtk.Window window;
- GtkClutter.Embed embed;
- Clutter.Stage stage;
- Gdk.RGBA color = {1.0, 0.0, 0.0, 1.0}; /* 100% opaque red */
- Gdk.RGBA transparent = {0.0, 1.0, 0.0, 0.5}; /* 100% transparent green */
- Clutter.Color c_color = {255, 255, 255, 0}; /* 100% transparent white*/
- window = new Gtk.Window();
- embed = new GtkClutter.Embed();
- embed.margin_top = 50;
- window.add(embed);
- window.set_default_size (250, 250);
- stage = embed.get_stage () as Clutter.Stage;
- stage.use_alpha = true;
- stage.background_color = c_color;
- window.override_background_color(Gtk.StateFlags.NORMAL, color);
- embed.override_background_color(Gtk.StateFlags.NORMAL, transparent);
- window.show_all();
- Gtk.main ();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement