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 Oct 24, 2014 2:41 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Opacity for toplevel window
PostPosted: Thu Sep 19, 2013 4:05 am 
Offline
Familiar Face

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

In GTK+ 3.8.0 , gtk_widget_set_opacity is not working at all for top level windows .
Is there any way to set opacity to toplevel windows .

Regards
Hkishn


Top
 Profile  
 
 Post subject: Re: Opacity for toplevel window
PostPosted: Thu Sep 19, 2013 6:38 pm 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 764
Location: UK
Hi,

How are you using the API call?

Also are you sure that you have a composting window manager?

_________________
E.


Top
 Profile  
 
 Post subject: Re: Opacity for toplevel window
PostPosted: Mon Sep 23, 2013 6:10 am 
Offline
Familiar Face

Joined: Thu Nov 01, 2012 5:48 am
Posts: 30
#include <gtk/gtk.h>
#include <stdlib.h>
#include <stdio.h>

GtkWidget *window;
GdkRGBA color;



int main( int argc,
char *argv[] )
{

gtk_init (&argc, &argv);

window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

gtk_window_set_default_size(GTK_WINDOW(window),600,400);

gdk_rgba_parse (&color, "blue");

gtk_widget_override_background_color (window , 0, &color);

gtk_widget_show_all ( window ) ;

gtk_widget_set_opacity ( window , 0.5 ) ;

gtk_main ();

return 0;
}



Yes , I have compositing window manager . Opacity is working on child widgets but not on top level windows .


Top
 Profile  
 
 Post subject: Re: Opacity for toplevel window
PostPosted: Thu Sep 26, 2013 5:34 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 764
Location: UK
The code worked for me on Debian testing (Jessie).

You may want to set the opacity before you show the window as on MS Windows this can cause the window to flicker once.

_________________
E.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 2 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