Create » History » Version 7
iri, 02/22/2011 03:30 PM
1 | 1 | iri | h1. Create a button |
---|---|---|---|
2 | |||
3 | 7 | iri | h2. _gtkButtonNew : |
4 | 1 | iri | > Create a button. |
5 | > Differents styles are available : |
||
6 | |||
7 | > * Classic (flag = SCOL_GTK_BUTTON_LABEL) |
||
8 | !http://library.gnome.org/devel/gtk/unstable/button.png! |
||
9 | > * With Mnemonic (like a keybord shortcut) (flag = SCOL_GTK_BUTTON_MNEMONIC) |
||
10 | !http://library.gnome.org/devel/gtk/unstable/button.png! |
||
11 | > * With a stock item (standard icon like "open", "exit", "copy", ...) (flag = SCOL_GTK_BUTTON_STOCKITEM) |
||
12 | |||
13 | > * With a link (uri) (flag = SCOL_GTK_BUTTON_LINK) |
||
14 | !http://library.gnome.org/devel/gtk/unstable/link-button.png! |
||
15 | > * A check box (with a short label) (flag = SCOL_GTK_BUTTON_CHECK) |
||
16 | !http://library.gnome.org/devel/gtk/unstable/check-button.png! |
||
17 | > * With a toggle state (flag = SCOL_GTK_BUTTON_TOGGLE) |
||
18 | !http://library.gnome.org/devel/gtk/unstable/toggle-button.png! |
||
19 | > * With a switch (flag = SCOL_GTK_BUTTON_SWITCH) |
||
20 | !http://library.gnome.org/devel/gtk/unstable/switch.png! |
||
21 | 7 | iri | > * A radio button with label (flag = SCOL_GTK_BUTTON_RADIO) |
22 | !http://library.gnome.org/devel/gtk/unstable/radio-group.png! |
||
23 | 1 | iri | > * An empty button (flag = SCOL_GTK_BUTTON_EMPTY) : can add a valid widget, like an image widget, etc ... |
24 | |||
25 | > h3. Prototype : |
||
26 | >> fun [Chn S I u0] ObjGtkWidget |
||
27 | |||
28 | >> * Channel : Chn |
||
29 | >>> any channel |
||
30 | |||
31 | >> * Label : S |
||
32 | 2 | iri | >>> Can be any label (with SCOL_GTK_BUTTON_LABEL, SCOL_GTK_BUTTON_TOGGLE, SCOL_GTK_BUTTON_SWITCH) |
33 | |||
34 | 1 | iri | >>> a mnemonic label (with SCOL_GTK_BUTTON_MNEMONIC) |
35 | 2 | iri | |
36 | 1 | iri | >>> or a stock item name (with SCOL_GTK_BUTTON_STOCKITEM). |
37 | 2 | iri | |
38 | 1 | iri | >>> Should be nil with SCOL_GTK_BUTTON_EMPTY. |
39 | |||
40 | >> * flag : I |
||
41 | >>> SCOL_GTK_BUTTON_EMPTY : empty button. Cf 'param'. |
||
42 | 2 | iri | |
43 | 1 | iri | >>> SCOL_GTK_BUTTON_LABEL : classical button with the label 'label'. |
44 | 2 | iri | |
45 | 1 | iri | >>> SCOL_GTK_BUTTON_MNEMONIC : a button with a mnemonic (can be activate with ALT + key). |
46 | 2 | iri | |
47 | 1 | iri | >>> SCOL_GTK_BUTTON_STOCKITEM : a button with a standard stock item. |
48 | 2 | iri | |
49 | 1 | iri | >>> SCOL_GTK_BUTTON_LINK : button with a link (uri). |
50 | 2 | iri | |
51 | 1 | iri | >>> SCOL_GTK_BUTTON_CHECK : check button (with mnemonic) with a short label |
52 | 2 | iri | |
53 | 1 | iri | >>> SCOL_GTK_BUTTON_TOGGLE : toggle button |
54 | 2 | iri | |
55 | 6 | iri | >>> SCOL_GTK_BUTTON_SWITCH : switch button. GTK+ 3.0 or + is needed. Otherwise, a toggled button will be created. |
56 | 1 | iri | |
57 | 7 | iri | >>> SCOL_GTK_BUTTON_RADIO : a radio button. You can see [[Examples]] section for more details to include it |
58 | |||
59 | 1 | iri | >> * param : u0 |
60 | >>> A supplemental parameter if flag need |
||
61 | 2 | iri | |
62 | 1 | iri | >>> ObjGtkWidget : child. If Type is SCOL_GTK_BUTTON_EMPTY only , child will be displayed into the new button. |
63 | 2 | iri | |
64 | 1 | iri | >>> S : url if type set to SCOL_GTK_BUTTON_LINK only |
65 | 2 | iri | |
66 | 1 | iri | >>> I : active (1), inactive (0) if flag is SCOL_GTK_BUTTON_CHECK, SCOL_GTK_BUTTON_TOGGLE or SCOL_GTK_BUTTON_SWITCH |
67 | 7 | iri | |
68 | >>> [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). |
||
69 | 2 | iri | |
70 | 3 | iri | >>> *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. |
71 | 2 | iri | |
72 | 4 | iri | >> +Return+ : ObjGtkWidget |
73 | |||
74 | 5 | iri | >>> The new Scol button object or nil if error |
75 | 4 | iri | |
76 | 2 | iri | Return [[Buttons]] |