Create » History » Revision 8
Revision 7 (iri, 02/22/2011 03:30 PM) → Revision 8/9 (iri, 02/22/2011 03:31 PM)
h1. Create a button h2. _gtkButtonNew : > Create a button. One function to create these buttons > 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! > * A radio button with label (flag = SCOL_GTK_BUTTON_RADIO) !http://library.gnome.org/devel/gtk/unstable/radio-group.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. >>> SCOL_GTK_BUTTON_RADIO : a radio button. You can see [[Examples]] section for more details to include it >> * 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 >>> [ObjGtkWidget I] : if the flag is SCOL_GTK_BUTTON_RADIO : object is the first button group (so, nil if it's the first !), the integer is the initial state (1 or 0). >>> *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]]