I am doing this tutorial, Beginners Tutorials, Loading Content From A File, found here:
About half way down the function names stop following name syntac.
‘The on_open_response function handles the response of the user once they have selected the file and closed the dialog, or simply closed the dialog without selecting a file:’
All other functions start with the .c file name i.e. text_viewer_window__open_…
And there is no mention where this function should be placed.
When I add this function, and all the rest in the tutorial, to the file and tried running it did not compile.
My real question is, has anyone followed this tutorial?
I am not unwilling to learn and adjust, just really want to know what I am missing, which happens too often.
Yes, the names of the functions don’t always follow a strict naming policy—mainly for signal handlers or async callback, because they’d get too long. Mainly, it’s a crutch because C does not have lambdas or anonymous functions; in other languages, we’d inline the callback.
I’m happy to update the name, though.
In the specific case of on_open_response, it should be defined before call to gtk_file_dialog_open(); that’s pretty much always the case with C: functions get defined (or at least declared) first, and then used.
The tutorial assumes you already know the language you’re following along; if you’re also learning C, it’s going to be a pretty steep learning curve to add GTK to the mix.
Additionally, the tutorial is meant to be followed as a way to get started with the GNOME platform; it’s not a programming tutorial.
Hello ebassi,
Well, the names were getting a little long, lol.
I did add them as per the tutorial before the reference calls.
It is those assumes that all ways get me.
I will redo and if I may, can I past what I am getting here for yall to look at?