Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8828431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:36:18+00:00 2026-06-14T07:36:18+00:00

Gist : handler_block is useful on a case-by-case basis, but I’d rather call something

  • 0

Gist:

handler_block is useful on a case-by-case basis, but I’d rather call something at the beginning of the program to suppress a signal for all calls to gtk_entry_set_text and gtk_toggle_button_set_active. Is there a way?


Background Info:

My program is used to make Entities via a character creator dialog box with the following attributes:

Name – chosen from a predetermined list via GTKComboBoxes

Animation – also a GTKComboBox

Group – one of six radio buttons classifying the entity

Entities can be added – one starts with a blank Add dialog, fills in all fields, and submits.

Entities can be edited via the Edit dialog, where all the fields listed above are initially filled in with the entity’s current attributes. The edits are instantaneous (no Submit button on the Edit dialog) and the displayed Entity will appear different as soon as the new value from the combo or radio buttons is selected.

I have a callback connected to the Type entry and triggered by the “changed” signal. The callback seems to trigger whenever I set the entry text manually in code to show the entity being edited:

gtk_entry_set_text(GTK_ENTRY(name_entry), entity.name); // name is a char*
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (group_button_friendly), TRUE);

Yeah, there is a way with g_signal_handler_block, but that requires

1) getting the gulong that is created when you connect the signal in the first place.
g_signal_connect(args);
vs.
gulong entry_handler_id = g_signal_connect(args);

2) Using the block/unblock idiom for every single call.

g_signal_handler_block(args, entry_handler_id);

gtk_entry_set_text(args);

g_signal_handler_unblock(args, entry_handler_id);

or worse,

g_signal_handler_block(args, entry_handler_id);

fn_that_calls_gtk_entry_set_text();

g_signal_handler_unblock(args, entry_handler_id);

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:36:19+00:00Added an answer on June 14, 2026 at 7:36 am

    I think what you’re looking for is g_signal_handlers_block_matched. If you set the mask to just G_SIGNAL_MATCH_CLOSURE with the closure used in the signal it should do the trick.

    You’ll have to look up the signal_id for the signal that is being emitted, but you should only need to do that once since the signal id is the same between all widgets, which is why the instance is required in the call as well.

    And to unblock you want to use g_signal_handlers_unblock_matched.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm replacing all the inline gist snippets w/ a div to load them in
I have added this fix https://gist.github.com/2382288 for protect all fields against mass assignment in
This is the gist the program : while(true) { //bunch of codes that gets
Here's the gist of what I'm trying to do. I have a list of
I learned of gist.github.com from Mozilla Ubiquity , and have been using it to
So i get the gist of $.delegate and I know why it's doing what
I understand the gist of the code, that it forms permutations; however, I was
here is the gist of the problem. If you want then you can read
Trying to use this method (gist of which is use self.method_name in the FunnyHelper
I'm trying to create a public gist via javascript. I'm not using any authentication

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.