73 Table(
short int rows,
short int cols,
bool homogeneous=
true, GtkAttachOptions xOpt=GTK_EXPAND, GtkAttachOptions yOpt=GTK_EXPAND,
uint xPad=0,
uint yPad=0){
74 initialise(rows, cols, homogeneous, xOpt, yOpt, xPad, yPad);
87 void initialise(
short int rows=2,
short int cols=2,
bool homogeneous=
true, GtkAttachOptions xOpt=GTK_FILL, GtkAttachOptions yOpt=GTK_FILL,
uint xPad=0,
uint yPad=0){
88 widget=gtk_table_new(rows, cols, homogeneous);
91 xStart=yStart=0; xEnd=yEnd=1;
98 gtk_table_set_homogeneous(GTK_TABLE(
widget),homogeneous);
105 void setOptions(GtkAttachOptions xOpt, GtkAttachOptions yOpt){
116 void setRegion(
short int x_s,
short int x_e,
short int y_s,
short int y_e){
117 xStart=x_s; xEnd=x_e;
118 yStart=y_s; yEnd=y_e;
126 void placeWidget(GtkWidget *obj, GtkAttachOptions xOpt, GtkAttachOptions yOpt){
127 xOptions=xOpt; yOptions=yOpt;
140 gtk_table_attach(GTK_TABLE(
widget), obj, xStart, xEnd, yStart, yEnd, xOptions, yOptions, xPadding, yPadding);
146 if (++xStart==(
int)cols){
149 if (++yStart==(
int)rows){
160 if ((gtk_major_version<=2) & (gtk_minor_version<22))
161 g_object_get (GTK_TABLE(
widget),
"n-rows", rows,
"n-columns", cols, NULL);
163 gtk_table_get_size(GTK_TABLE(
widget), rows, cols);
171 xPadding = xPad; yPadding = yPad;
179 gtk_table_resize(GTK_TABLE(
widget), rows, cols);
192 if (regionTemp.size()<4){
193 regionTemp.push_back(i);
194 if (regionTemp.size()==4){
195 setRegion(regionTemp[0], regionTemp[1], regionTemp[2], regionTemp[3]);
199 std::cerr<<
"Table region is already specified, try dropping this ',int' variable"<<std::endl;
220 setRegion(region[0], region[1], region[2], region[3]);
239 Table& operator <<(LinkList<GtkWidget *> &ll) {
240 ll.grab(1); ll.prev();
241 for (
int i=0;i<ll.getCount();i++)
282 gtk_container_remove(GTK_CONTAINER(
widget),obj);
311 operator>>(ll.
next());
guint yPadding
The vertical padding between widgets.
std::vector< int > regionTemp
This region starts empty, when it gets 4 elements, it sets the region.
Table & operator>>(Container &c)
void resize(uint rows, uint cols)
short int yEnd
The table row location to end attachment.
void setPadding(uint xPad, uint yPad)
void getSize(uint *rows, uint *cols)
void setOptions(GtkAttachOptions xOpt, GtkAttachOptions yOpt)
TYPE grab(int i)
returns the i'th lug in the chain irrespective of direction
short int xStart
The table column location to start attachment from.
TYPE prev(void)
Return a pointer to the previous lug and move to that lug Increments against dir (either forward or b...
short int xEnd
The table column location to end attachment.
GtkAttachOptions yOptions
The vertical fill options, one of : GTK_EXPAND, GTK_SHRINK, GTK_FILL.
Table & operator<<(GtkWidget *obj)
Table & operator<<(int *region)
guint xPadding
The horizontal padding between widgets.
void placeWidget(GtkWidget *obj)
TYPE next(void)
Return a pointer to the next lug and move on to that lug Increments according to dir (either forward ...
void setHomogeneous(bool homogeneous)
GtkAttachOptions xOptions
The horizontal fill options, one of : GTK_EXPAND, GTK_SHRINK, GTK_FILL.
Table & operator>>(GtkWidget *obj)
Table & operator>>(Container *c)
void setRegion(short int x_s, short int x_e, short int y_s, short int y_e)
Table & operator<<(int i)
void placeWidget(GtkWidget *obj, GtkAttachOptions xOpt, GtkAttachOptions yOpt)
void initialise(short int rows=2, short int cols=2, bool homogeneous=true, GtkAttachOptions xOpt=GTK_FILL, GtkAttachOptions yOpt=GTK_FILL, uint xPad=0, uint yPad=0)
short int yStart
The table row location to start attachment from.
Table(short int rows, short int cols, bool homogeneous=true, GtkAttachOptions xOpt=GTK_EXPAND, GtkAttachOptions yOpt=GTK_EXPAND, uint xPad=0, uint yPad=0)