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