Create » History » Revision 3
« Previous |
Revision 3/9
(diff)
| Next »
iri, 02/22/2011 12:46 AM
Create a button¶
- _gtkButtonNew :
Create a button.
Differents styles are available :
- Classic (flag = SCOL_GTK_BUTTON_LABEL)
- With Mnemonic (like a keybord shortcut) (flag = SCOL_GTK_BUTTON_MNEMONIC)
- With a stock item (standard icon like "open", "exit", "copy", ...) (flag = SCOL_GTK_BUTTON_STOCKITEM)
- With a link (uri) (flag = SCOL_GTK_BUTTON_LINK)
- A check box (with a short label) (flag = SCOL_GTK_BUTTON_CHECK)
- With a toggle state (flag = SCOL_GTK_BUTTON_TOGGLE)
- With a switch (flag = SCOL_GTK_BUTTON_SWITCH)
- An empty button (flag = SCOL_GTK_BUTTON_EMPTY) : can add a valid widget, like an image widget, etc ...
Prototype :¶
fun [Chn S I u0] ObjGtkWidget
- Channel : Chn
any channel
- Label : S
Can be any label (with SCOL_GTK_BUTTON_LABEL, SCOL_GTK_BUTTON_TOGGLE, SCOL_GTK_BUTTON_SWITCH)
a mnemonic label (with SCOL_GTK_BUTTON_MNEMONIC)
or a stock item name (with SCOL_GTK_BUTTON_STOCKITEM).
Should be nil with SCOL_GTK_BUTTON_EMPTY.
- flag : I
SCOL_GTK_BUTTON_EMPTY : empty button. Cf 'param'.
SCOL_GTK_BUTTON_LABEL : classical button with the label 'label'.
SCOL_GTK_BUTTON_MNEMONIC : a button with a mnemonic (can be activate with ALT + key).
SCOL_GTK_BUTTON_STOCKITEM : a button with a standard stock item.
SCOL_GTK_BUTTON_LINK : button with a link (uri).
SCOL_GTK_BUTTON_CHECK : check button (with mnemonic) with a short label
SCOL_GTK_BUTTON_TOGGLE : toggle button
SCOL_GTK_BUTTON_SWITCH : switch button
- param : u0
A supplemental parameter if flag need
ObjGtkWidget : child. If Type is SCOL_GTK_BUTTON_EMPTY only , child will be displayed into the new button.
S : url if type set to SCOL_GTK_BUTTON_LINK only
I : active (1), inactive (0) if flag is SCOL_GTK_BUTTON_CHECK, SCOL_GTK_BUTTON_TOGGLE or SCOL_GTK_BUTTON_SWITCH
WARNING : the type of the last argument is u0. Be careful : your type should be the good type (S if flag is SCOL_GTK_BUTTON_LINK by example). Otherwise, your application will compile but it will risk to crash to the running.
Return Buttons
Updated by iri almost 14 years ago · 3 revisions