GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Aug 26, 2016 11:24 pm

All times are UTC

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Opacity in Toplevel window
PostPosted: Tue Sep 10, 2013 9:09 am 
Familiar Face

Joined: Thu Nov 01, 2012 5:48 am
Posts: 30
Hi All ,

For GTK+ 3.8 onwards to set opacity gtk_widget_set_opacity is used ( gtk_window_set_opacity has been deprecated ).
I made a sample in which a button is created under toplevel window . The above opacity works for buttons ( child widgets ) not for toplevel window .
If I set the opacity in toplevel window , then it has no effect .
Could anyone tell how to set the opacity to level window .

code snippet :

int main( int argc,
char *argv[] )
GtkWidget *window;
GtkWidget *button;
GdkRGBA color ;

gtk_init (&argc, &argv);

GtkBuilder *builder = gtk_builder_new ();

gtk_builder_add_from_file (builder, "", NULL);

window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
button = GTK_WIDGET (gtk_builder_get_object (builder, "button1"));

gdk_rgba_parse (&color, "blue");
gtk_widget_override_background_color (window , 0, &color);
gtk_widget_set_opacity ( window , 0.5 );

gtk_widget_show_all (window);

gtk_main ();

return 0;

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 3 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group