Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

APPENDIX F: Exercise Solutions and Hints > Exercise 6-1. Working with Files

Exercise 6-1. Working with Files

This exercise is meant to take what you have learned about file manipulation in Chapter 6 and integrate it with the widgets from previous chapters. The user interface for this exercise should include three widgets: GtkEntry, GtkFileChooserButton, and GtkButton.

The GtkEntry widget will allow the user to enter a single line of text that will be saved in a file on the system. The location of the file is chosen in the GtkFileChooserButton widget with an action of GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER. Lastly, the GtkButton widget will initiate the saving of the file when it is clicked. In the downloadable exercise solution, the text will be saved to a file named arbitrary_file at the selected location when the user clicks the button.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial