Create » History » Revision 6
Revision 5 (iri, 02/22/2011 12:50 AM) → Revision 6/9 (iri, 02/22/2011 12:33 PM)
h1. Create a button * _gtkButtonNew : > Create a button. > Differents styles are available : > * Classic (flag = SCOL_GTK_BUTTON_LABEL) !http://library.gnome.org/devel/gtk/unstable/button.png! > * With Mnemonic (like a keybord shortcut) (flag = SCOL_GTK_BUTTON_MNEMONIC) !http://library.gnome.org/devel/gtk/unstable/button.png! > * With a stock item (standard icon like "open", "exit", "copy", ...) (flag = SCOL_GTK_BUTTON_STOCKITEM) > * With a link (uri) (flag = SCOL_GTK_BUTTON_LINK) !http://library.gnome.org/devel/gtk/unstable/link-button.png! > * A check box (with a short label) (flag = SCOL_GTK_BUTTON_CHECK) !http://library.gnome.org/devel/gtk/unstable/check-button.png! > * With a toggle state (flag = SCOL_GTK_BUTTON_TOGGLE) !http://library.gnome.org/devel/gtk/unstable/toggle-button.png! > * With a switch (flag = SCOL_GTK_BUTTON_SWITCH) !http://library.gnome.org/devel/gtk/unstable/switch.png! > * An empty button (flag = SCOL_GTK_BUTTON_EMPTY) : can add a valid widget, like an image widget, etc ... > h3. 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. GTK+ 3.0 or + is needed. Otherwise, a toggled button will be created. >> * 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+ : ObjGtkWidget >>> The new Scol button object or nil if error Return [[Buttons]]