create() returns handle to newly-created widget: win = create(GtkWindow)
set() sets a property for a widget: set(win,"background","blue")
get() gets a property: ? get(win,"background")
add() adds a widget to a container: add(win,panel); spaces divided equally
pack_start() adds at top/left
pack_end() adds at bottom/right
show() show a widget: show(btn)
show_all() show a container and all items contained within: show_all(win)
hide() hide a widget: hide(btn)
hide_all() hide a container and all items contained within: hide_all(win)
connect() connect a signal to a Eu function: connect(btn1,"clicked","FooBar",33) Note: connect() returns a sigid, usually ignored unless you plan to disconnect.
disconnect() disconnect a signal: disconnect(btn1,sigid)
main() start the GTK main processing loop: main()
requires() pop up an Error dialog if not available: requires("3.10","GtkRevealer")
destroy() destroy a widget: destroy(win)
unpack() convert data attached to a control back into format usable by Euphoria: unpack(data)
show_uri() call default handler for uri (file, http, etc...): show_uri("http://gtk.org")
"Quit" global call to shut down the GTK main processing loop: connect(win,"destroy","Quit")
pointer() obtains a handle, a.k.a. pointer, to an object loaded from Glade
constant win = pointer("help:window1")
_() shorthand for call_back(routine_id()), links signals to local functions, no global declarations required
$... shorthand for signal links e.g. $destroy=Quit
See HowItWorks for details on the above functions, you will use some of them frequently!
Below are unique identifiers used to specify storage types in List/Tree models, not only do these control how the value
is stored, but also how it is displayed:
gINT Store and display as an integer (rounds floats down)
gDBL Store and display as a double
gSTR Store and display as a string
gPTR Generic pointer - seldom used
gFLT Displays with six digits following the decimal point
gBOOL anything other than 0 displays TRUE, 0 displays FALSE
gPIX Stores handle to a pixbuf, displays that image
gCOMBO Stores handle to a GtkComboBox
Unique identifiers below save space in method prototypes;
programmer may use them when calling the three user functions which follow.
P = C_POINTER expected parameter is a pointer
I = C_INT expected parameter is an integer
S = E_OBJECT expected parameter is a string
B = C_BYTE expected parameter is boolean
D = C_DOUBLE expected parameter is a double
F = C_FLOAT expected parameter is a floating-point value
A = E_SEQUENCE expected parameter is an array
User functions
While mostly used internally by EuGTK, they may be useful
when testing or when implementing GTK methods which haven't been added to EuGTK.