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 8251553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:16:30+00:00 2026-06-08T00:16:30+00:00

I’m working on a Glade3 interface using the C language. So far, I have

  • 0

I’m working on a Glade3 interface using the C language.

So far, I have two places where a user picks where to save a file. I have a GtkFileChooserDialog that opens when you click a browse button. When you click save on that dialog, it fills a GtkEntry that was next to the Browse button.

It works the first time you select a file, but the second time, gtk_file_chooser_get_filename() returns nothing, even if you enter something in the dialog.

Here is a simplified version of the source code, that still has the problem: http://paste.ubuntu.com/1032567/ and the Glade3 interface file to go with it: http://paste.ubuntu.com/1032572/

I have two places in my UI with a setup like this. Happens on both of them. I have two different callback functions–one is an older attempt to do it right and another is my latest attempt. Neither one works, though the newer avoids segfaulting because it checks to see if what is returned is null.

The newer callback is on_button5_clicked() and the older on_button3_clicked.

I’ve looked at the reference, and I didn’t see anything about why it would return a null pointer even though you have a filename choosen.

Any help would be greatly appreciated. (I feel like I’m at the headbanging stage).

EDIT:
So, I had a few more ideas of things to try. First, I tried making my own windows with a FileChooser widget, instead of having a dialog. I did this to make sure that the dialog was not having trouble with not being run with a gtk_Dialog_Run call. I also tried repeating the code that gets and checks to see if the pointer to the filename string is not null. When it is run for the second time in the same callback call, it returns a non-null string pointer. I also did this to make sure that it wasn’t something to do with the fact that the window the dialog is launched (actually, gtk_widget_show()ED) from is itself a dialog.

I tried my theory that I have to set the buttons in the dialog to have gtk.RESPONSE_OK or gtk_RESPONSE_CANCEL responses. That didn’t seem to have any effect.

  • 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-08T00:16:32+00:00Added an answer on June 8, 2026 at 12:16 am

    It seems that calling gtk_file_chooser_get_filename() will return null the second time hidden and shown the widget, unless you call gtk_file_chooser_set_filename().

    I do not see anything in the documentation about this, but most of the time, it would make sense to set the file name before showing it because whatever you were getting the filename for could have been changed, and so it makes sense to update the file chooser anyways.

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I have thousands of HTML files to process using Groovy/Java and I need to
I have a reasonable size flat file database of text documents mostly saved in
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,

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.