CoreGTK 3.10.0 CoreGTK is an Objective-C language binding for the GTK+ widget toolkit

- Main Page
- Classes
- Files

- File List

All Classes Functions Variables
CGTKGrid.m
1 /*
2 * CGTKGrid.m
3 * This file is part of CoreGTK
4 *
5 * Copyright (C) 2015 - Tyler Burton
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 /*
23 * Modified by the CoreGTK Team, 2015. See the AUTHORS file for a
24 * list of people on the CoreGTK Team.
25 * See the ChangeLog files for a list of changes.
26 *
27 */
28
29 /*
30 * Objective-C imports
31 */
32 #import "CoreGTK/CGTKGrid.h"
33
34 @implementation CGTKGrid
35
36 -(id)init
37 {
38 self = [super initWithGObject:(GObject *)gtk_grid_new()];
39
40 if(self)
41 {
42 //Do nothing
43 }
44
45 return self;
46 }
47
48 -(GtkGrid*)GRID
49 {
50 return GTK_GRID([self GOBJECT]);
51 }
52
53 -(void)attachWithChild:(CGTKWidget*) child andLeft:(gint) left andTop:(gint) top andWidth:(gint) width andHeight:(gint) height
54 {
55 gtk_grid_attach(GTK_GRID([self GOBJECT]), [child WIDGET], left, top, width, height);
56 }
57
58 -(void)attachNextToWithChild:(CGTKWidget*) child andSibling:(CGTKWidget*) sibling andSide:(GtkPositionType) side andWidth:(gint) width andHeight:(gint) height
59 {
60 gtk_grid_attach_next_to(GTK_GRID([self GOBJECT]), [child WIDGET], [sibling WIDGET], side, width, height);
61 }
62
63 -(gint)getBaselineRow
64 {
65 return gtk_grid_get_baseline_row(GTK_GRID([self GOBJECT]));
66 }
67
68 -(CGTKWidget*)getChildAtWithLeft:(gint) left andTop:(gint) top
69 {
70 return [[CGTKWidget alloc] initWithGObject:(GObject *)gtk_grid_get_child_at(GTK_GRID([self GOBJECT]), left, top)];
71 }
72
73 -(BOOL)getColumnHomogeneous
74 {
75 return (gtk_grid_get_column_homogeneous(GTK_GRID([self GOBJECT])) ? YES : NO);
76 }
77
78 -(guint)getColumnSpacing
79 {
80 return gtk_grid_get_column_spacing(GTK_GRID([self GOBJECT]));
81 }
82
83 -(GtkBaselinePosition)getRowBaselinePosition:(gint) row
84 {
85 return gtk_grid_get_row_baseline_position(GTK_GRID([self GOBJECT]), row);
86 }
87
88 -(BOOL)getRowHomogeneous
89 {
90 return (gtk_grid_get_row_homogeneous(GTK_GRID([self GOBJECT])) ? YES : NO);
91 }
92
93 -(guint)getRowSpacing
94 {
95 return gtk_grid_get_row_spacing(GTK_GRID([self GOBJECT]));
96 }
97
98 -(void)insertColumn:(gint) position
99 {
100 gtk_grid_insert_column(GTK_GRID([self GOBJECT]), position);
101 }
102
103 -(void)insertNextToWithSibling:(CGTKWidget*) sibling andSide:(GtkPositionType) side
104 {
105 gtk_grid_insert_next_to(GTK_GRID([self GOBJECT]), [sibling WIDGET], side);
106 }
107
108 -(void)insertRow:(gint) position
109 {
110 gtk_grid_insert_row(GTK_GRID([self GOBJECT]), position);
111 }
112
113 -(void)removeColumn:(gint) position
114 {
115 gtk_grid_remove_column(GTK_GRID([self GOBJECT]), position);
116 }
117
118 -(void)removeRow:(gint) position
119 {
120 gtk_grid_remove_row(GTK_GRID([self GOBJECT]), position);
121 }
122
123 -(void)setBaselineRow:(gint) row
124 {
125 gtk_grid_set_baseline_row(GTK_GRID([self GOBJECT]), row);
126 }
127
128 -(void)setColumnHomogeneous:(BOOL) homogeneous
129 {
130 gtk_grid_set_column_homogeneous(GTK_GRID([self GOBJECT]), (homogeneous ? TRUE : FALSE));
131 }
132
133 -(void)setColumnSpacing:(guint) spacing
134 {
135 gtk_grid_set_column_spacing(GTK_GRID([self GOBJECT]), spacing);
136 }
137
138 -(void)setRowBaselinePositionWithRow:(gint) row andPos:(GtkBaselinePosition) pos
139 {
140 gtk_grid_set_row_baseline_position(GTK_GRID([self GOBJECT]), row, pos);
141 }
142
143 -(void)setRowHomogeneous:(BOOL) homogeneous
144 {
145 gtk_grid_set_row_homogeneous(GTK_GRID([self GOBJECT]), (homogeneous ? TRUE : FALSE));
146 }
147
148 -(void)setRowSpacing:(guint) spacing
149 {
150 gtk_grid_set_row_spacing(GTK_GRID([self GOBJECT]), spacing);
151 }
152
153
154 @end
-[CGTKBase GOBJECT]
GObject * GOBJECT()
Definition: CGTKBase.m:82
-[CGTKGrid getColumnHomogeneous]
BOOL getColumnHomogeneous()
Definition: CGTKGrid.m:73
-[CGTKBase initWithGObject:]
id initWithGObject:(GObject *obj)
Definition: CGTKBase.m:48
-[CGTKGrid getRowHomogeneous]
BOOL getRowHomogeneous()
Definition: CGTKGrid.m:88
-[CGTKWidget WIDGET]
GtkWidget * WIDGET()
Definition: CGTKWidget.m:61
-[CGTKGrid GRID]
GtkGrid * GRID()
Definition: CGTKGrid.m:48
-[CGTKGrid init]
id init()
Definition: CGTKGrid.m:36
CGTKWidget
Definition: CGTKWidget.h:34
-[CGTKGrid getBaselineRow]
gint getBaselineRow()
Definition: CGTKGrid.m:63
-[CGTKGrid getColumnSpacing]
guint getColumnSpacing()
Definition: CGTKGrid.m:78
CGTKGrid
Definition: CGTKGrid.h:34
-[CGTKGrid getRowSpacing]
guint getRowSpacing()
Definition: CGTKGrid.m:93