This works but ...
gtk_window_set_icon_(WindowID(Window_0), GetGadgetPixbuf(?icon, size))
But, why does this function have to be named with the _ underscore behind gtk_window_set_icon_ ?
In the Gtk-library it is simply gtk_window_set_icon, yet the function doesn't have to be imported too, so can anyone explain a bit about all that ?
More about things here :
https://www.purebasic.fr/english/viewt ... e&start=15
Thanks
P.s. It's a choice, keep doing things without understanding them or learning something new.
Why the underscore behind gtk_window_set_icon_ ???
Why the underscore behind gtk_window_set_icon_ ???
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.
Re: Why the underscore behind gtk_window_set_icon_ ???
To make the compiler distinguish it from regular functions
Re: Why the underscore behind gtk_window_set_icon_ ???
What he said.
OS API calls use that nomenclature to denote a function that you aren't defining in your code, so you don't have to declare it as an external function
It's a syntactical decision Fred made to give us a shortcut to API calls, without locking us out of using those function names in our own code. Between all of the OS's, there's so many api functions that it's statistically likely to have name collisions otherwise.
OS API calls use that nomenclature to denote a function that you aren't defining in your code, so you don't have to declare it as an external function
It's a syntactical decision Fred made to give us a shortcut to API calls, without locking us out of using those function names in our own code. Between all of the OS's, there's so many api functions that it's statistically likely to have name collisions otherwise.
Re: Why the underscore behind gtk_window_set_icon_ ???
Hi,
My point is more, why do some need that underscore and others not (like these below) ?
When or how to know, it needs the underscore or it needs to be imported ?
Thanks
My point is more, why do some need that underscore and others not (like these below) ?
When or how to know, it needs the underscore or it needs to be imported ?
Thanks
Code: Select all
ImportC ""
gtk_button_set_image(*button.GtkButton, *image.GtkWidget)
gtk_button_set_image_position(*button.GtkButton, position)
gtk_button_set_label(*button.GtkButton, label.p-utf8)
gtk_image_clear(*image.GtkWidget)
gtk_image_new_from_pixbuf(*pimg)
g_object_set(*object.GObject, property_name.p-utf8, *data, v= 0)
gdk_pixbuf_loader_new.i()
gdk_pixbuf_loader_write.l(*loader, *buffer, *count, *error)
gdk_pixbuf_loader_get_pixbuf.i(*loader)
gdk_pixbuf_loader_close(*loader, *error)
EndImport
Yeah I know, but keep in mind ... Leonardo da Vinci was also an autodidact.
Re: Why the underscore behind gtk_window_set_icon_ ???
Many OS API functions are already imported. These can be called with underscore without extra import.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive