GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Wed Aug 31, 2016 12:26 am

All times are UTC

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Gtk CheckButton Activation
PostPosted: Sun Aug 25, 2013 3:16 pm 

Joined: Sat Aug 24, 2013 9:51 pm
Posts: 1
Is there a way to change the status of a gtk checkbutton without emitting a signal that will activate the checkbutton's signal handler? I'm writing an application that has a number of checkbuttons that change in different patterns according to which checkbutton a user selects ( to show how the program settings change in response to some user choice ). I've tried "gtk_toggle_button_set_active" and g_signal_emit_by_name but these functions emit a signal that calls the checkbutton's signal handler. I've tried to access the widget's data directly like this:

GTK_TOGGLE_BUTTON ( cutCheckBox ) -> active = true;

but g++ gives me errors like this:

error: ‘GtkToggleButton’ has no member named ‘active’

The only thing I haven't tried is "g_signal_handler_block" , which requires calling a bunch of api's everytime I want to set a checkbutton from within my code ( this seems inefficient ). Are there other ways of accomplishing this? Thanks for any information...

 Post subject: Re: Gtk CheckButton Activation
PostPosted: Wed Aug 28, 2013 8:58 am 
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 1048
Location: UK
Hello and welcome,

Any state change of a widget will involve emission of signals. This is all part of how GTK+ works and helps with getting redraws done, internal state changes etc.

There is now no direct access to any member variables of a widget and accessor functions must now be used.

If you want to block the signals to your application then you will have to use the g_signal_handler_block() / g_signal_handler_unblock() functions to do this.


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

All times are UTC

Who is online

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