1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
PROGRAM(table);
// A table is a grid you can place widgets in.
// IMG: GTK.Table(2,2,0)->attach_defaults( GTK.Label("0,0"), 0, 1, 0, 1)->attach_defaults( GTK.Label("0,1"), 0, 1, 1, 2)->attach_defaults( GTK.Label("1,0"), 1, 2, 0, 1)->attach_defaults( GTK.Label("1,1"), 1, 2, 1, 2)->set_col_spacings(10)->set_row_spacings(10)
// IMG: GTK.Table(2,2,0)->attach_defaults( GTK.Label("0,0-1,0"), 0, 2, 0, 1)->attach_defaults( GTK.Label("0,1"), 0, 1, 1, 2)->attach_defaults( GTK.Label("1,1"), 1, 2, 1, 2)->set_col_spacings(10)->set_row_spacings(10)
INHERIT(container);
COMPLEX_FUNCTION(create, int, int, int);
NAME_ARGS(width,height,homogeneousp);
// Arguments are: Width, height and homogeneous.
// The latter forces the all tablecells to be exactly the same size.
COMPLEX_FUNCTION(resize,int,int);
NAME_ARGS(rows,columns);
COMPLEX_FUNCTION(attach, widget, int, int, int, int, int, int, int, int);
NAME_ARGS(subwidget,left,right,top,bottom,xoptions,yoptions);
// Syntax: table->attach(widget, left, right, top, bottom, xoptions, yoptions, xpad, ypad);
// The left and right attach arguments specify where to place the
// widget, and how many boxes to use. If you want a button in the
// lower right table entry of our 2x2 table, and want it to fill that
// entry ONLY. left_attach would be = 1, right_attach = 2, top_attach
// = 1, bottom_attach = 2.
// <p>
// Now, if you wanted a widget to take up the whole top row of our 2x2
// table, you'd use left_attach = 0, right_attach = 2, top_attach = 0,
// bottom_attach = 1.
// </p>
// The xoptions and yoptions are used to specify packing options and
// may be OR'ed together to allow multiple options.
// <p>
// These options are:
// <ul>
// <li> GTK.FILL - If the table box is larger than the widget, and
// GTK_FILL is specified, the widget will expand to use all the room
// available.
// <li> GTK.SHRINK - If the table widget was allocated less space then
// was requested (usually by the user resizing the window), then the
// widgets would normally just be pushed off the bottom of the window
// and disappear. If GTK_SHRINK is specified, the widgets will shrink
// with the table.
// <li> GTK.EXPAND - This will cause the table cell to expand to use
// up any remaining space in the window. </ul>
// <p>
// Padding is just like in boxes, creating a clear area around the
// widget specified in pixels
COMPLEX_FUNCTION(attach_defaults, widget, int, int, int, int);
NAME_ARGS(subwidget,left,right,top,bottom);
// As attach, but xoptions, yoptions, xpadding and ypadding are set
// the their default values. for the options that is
// GTK.FILL|GTK.EXPAND. For pad it is 0.
COMPLEX_FUNCTION(set_col_spacing, int, int);
NAME_ARGS(x,spacing);
// Sets the spacing between column x and x+1, in pixels.
COMPLEX_FUNCTION(set_row_spacing, int, int);
NAME_ARGS(y,spacing);
// Sets the spacing between row y and y+1, in pixels.
COMPLEX_FUNCTION(set_col_spacings, int);
NAME_ARGS(spacing);
// The default spacing between columns, in pixels.
COMPLEX_FUNCTION(set_row_spacings, int);
NAME_ARGS(spacing);
// The default spacing between rows, in pixels.
COMPLEX_FUNCTION(set_homogeneous, int);
NAME_ARGS(homogeneousp);
// Set the homogeneous flag.
CLASSMEMBER(nrows,int);
CLASSMEMBER(ncols,int);
CLASSMEMBER(column_spacing,int);
CLASSMEMBER(row_spacing,int);
CLASSMEMBER(homogeneous,int);
|