GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Apr 24, 2014 5:21 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: GTK3 - textview transparency
PostPosted: Wed Nov 06, 2013 12:00 pm 
Offline

Joined: Tue Nov 05, 2013 11:28 pm
Posts: 2
I am currently working on an existing Linux application called Xpad, which is a sticky notes application written in C. I try to implement transparency but I have a hard time achieving what I want. A sticky note looks like this.

Image

I have a (toplevel) gtk_window with a gtk_textview. If the background color of the textview is set with the function gtk_widget_override_background_color() to a transparant color (GdkRGBA where alpha value is smaller than 1), the color of the gtk_window behind it, becomes more visible.

However, I don't want to see the gtk_window, but the applications behind the gtk_window, such as the browser, libreoffice, or the desktop.

If the gtk_window is set to a certain transparancy, either with gtk_widget_override_background_color() or with gtk_widget_set_opacity(), the whole widget, including the window decorations become (partially) transparent.

To make the relations between the visible objects more clear, I have created a diagram of the different parts, and marked the place where I believe the transparency issue is taking place.

Image

Anybody have any ideas how to make the textview background transparent, without making the window decorations transparent, so I can see whatever is behind this application?


Top
 Profile  
 
 Post subject: Re: GTK3 - textview transparency
PostPosted: Thu Nov 07, 2013 9:27 pm 
Offline
Familiar Face

Joined: Wed Jan 30, 2013 8:28 pm
Posts: 20
your toplevel windows is not transparent

gtk_window_set_opacity


Top
 Profile  
 
 Post subject: Re: GTK3 - textview transparency
PostPosted: Fri Nov 08, 2013 7:38 pm 
Offline

Joined: Tue Nov 05, 2013 11:28 pm
Posts: 2
Hi nar6du14,

Thanks for thinking along. If I make the toplevel transparent (for example 50%), then the whole pad becomes transparent, including the toolbar, the window decorations, etc. So, if I would use

Code:
gtk_widget_set_opacity (GTK_WIDGET (pad), 0.5);


This would be the result.

Image

If I would set the transparency of the toplevel window (is called pad) to 100% transparent, then all the pads are completely invisible.

I am looking for a way to make only the textview transparent.

Any other thoughts?


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

All times are UTC


Who is online

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