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 17, 2014 12:53 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Redefining "draw" callback for a widget and widget opacity
PostPosted: Sat Oct 15, 2011 2:31 am 
Offline

Joined: Sat Oct 15, 2011 2:27 am
Posts: 1
so the ultimate goal is to add a layer of opacity to a single widget, a whole window is pretty simple.

So I wanted to do something like
Code:
// Sets opacity for view
static void view_draw(GtkWidget *,cairo_t cr, gpointer data);

GtkWidget *view;
...
g_signal_connect(view,"draw",G_CALLBACK(view_draw),NULL);



But the problem is, all I want to do is set some opacity for a widget and by redefining draw, I can't actually draw the object X_X
is it possible to call the original draw callback after I'm done changing the alpha channels?

-Luke


Top
 Profile  
 
 Post subject: Re: Redefining "draw" callback for a widget and widget opaci
PostPosted: Thu Oct 20, 2011 9:54 pm 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
I don't see a draw callback listed for GtkWidget (http://developer.gnome.org/gtk/2.24/Gtk ... et.signals). Should this be the realised signal?
g_signal_connect (http://developer.gnome.org/gobject/stab ... al-connect) connects before the default handler so there should be no reason why the default handler for "draw" would not be called unless it doesn't exist or something went wrong in your callback.


Top
 Profile  
 
 Post subject: Re: Redefining "draw" callback for a widget and widget opaci
PostPosted: Fri Oct 21, 2011 6:24 am 
Offline
Never Seen the Sunlight

Joined: Wed Jul 23, 2008 10:31 am
Posts: 2406
Location: Slovenia
GtkWidget::draw signal is GTK+-3 equivalent of GtkWidget::expose-event signal in GTK+-2.

Cheers,
Tadej


Top
 Profile  
 
 Post subject: Re: Redefining "draw" callback for a widget and widget opaci
PostPosted: Sat Oct 22, 2011 10:10 am 
Offline
Never Seen the Sunlight

Joined: Thu Mar 24, 2011 2:10 pm
Posts: 328
Location: Sydney, Australia
Thanks Tadeboro,
In that case I have no idea. Can you post some more code Luke? Have you tested with gdb or something that your view_draw function is being called?


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: No registered users and 1 guest


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