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
CGTKListBox.m
1 /*
2 * CGTKListBox.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/CGTKListBox.h"
33
34 @implementation CGTKListBox
35
36 -(id)init
37 {
38 self = [super initWithGObject:(GObject *)gtk_list_box_new()];
39
40 if(self)
41 {
42 //Do nothing
43 }
44
45 return self;
46 }
47
48 -(GtkListBox*)LISTBOX
49 {
50 return GTK_LIST_BOX([self GOBJECT]);
51 }
52
53 -(void)dragHighlightRow:(GtkListBoxRow*) row
54 {
55 gtk_list_box_drag_highlight_row(GTK_LIST_BOX([self GOBJECT]), row);
56 }
57
58 -(void)dragUnhighlightRow
59 {
60 gtk_list_box_drag_unhighlight_row(GTK_LIST_BOX([self GOBJECT]));
61 }
62
63 -(BOOL)getActivateOnSingleClick
64 {
65 return (gtk_list_box_get_activate_on_single_click(GTK_LIST_BOX([self GOBJECT])) ? YES : NO);
66 }
67
68 -(GtkAdjustment*)getAdjustment
69 {
70 return gtk_list_box_get_adjustment(GTK_LIST_BOX([self GOBJECT]));
71 }
72
73 -(GtkListBoxRow*)getRowAtIndex:(gint) index
74 {
75 return gtk_list_box_get_row_at_index(GTK_LIST_BOX([self GOBJECT]), index);
76 }
77
78 -(GtkListBoxRow*)getRowAtY:(gint) y
79 {
80 return gtk_list_box_get_row_at_y(GTK_LIST_BOX([self GOBJECT]), y);
81 }
82
83 -(GtkListBoxRow*)getSelectedRow
84 {
85 return gtk_list_box_get_selected_row(GTK_LIST_BOX([self GOBJECT]));
86 }
87
88 -(GtkSelectionMode)getSelectionMode
89 {
90 return gtk_list_box_get_selection_mode(GTK_LIST_BOX([self GOBJECT]));
91 }
92
93 -(void)insertWithChild:(CGTKWidget*) child andPosition:(gint) position
94 {
95 gtk_list_box_insert(GTK_LIST_BOX([self GOBJECT]), [child WIDGET], position);
96 }
97
98 -(void)invalidateFilter
99 {
100 gtk_list_box_invalidate_filter(GTK_LIST_BOX([self GOBJECT]));
101 }
102
103 -(void)invalidateHeaders
104 {
105 gtk_list_box_invalidate_headers(GTK_LIST_BOX([self GOBJECT]));
106 }
107
108 -(void)invalidateSort
109 {
110 gtk_list_box_invalidate_sort(GTK_LIST_BOX([self GOBJECT]));
111 }
112
113 -(void)prepend:(CGTKWidget*) child
114 {
115 gtk_list_box_prepend(GTK_LIST_BOX([self GOBJECT]), [child WIDGET]);
116 }
117
118 -(void)selectRow:(GtkListBoxRow*) row
119 {
120 gtk_list_box_select_row(GTK_LIST_BOX([self GOBJECT]), row);
121 }
122
123 -(void)setActivateOnSingleClick:(BOOL) single
124 {
125 gtk_list_box_set_activate_on_single_click(GTK_LIST_BOX([self GOBJECT]), (single ? TRUE : FALSE));
126 }
127
128 -(void)setAdjustment:(GtkAdjustment*) adjustment
129 {
130 gtk_list_box_set_adjustment(GTK_LIST_BOX([self GOBJECT]), adjustment);
131 }
132
133 -(void)setFilterFuncWithFilterFunc:(GtkListBoxFilterFunc) filterFunc andUserData:(gpointer) userData andDestroy:(GDestroyNotify) destroy
134 {
135 gtk_list_box_set_filter_func(GTK_LIST_BOX([self GOBJECT]), filterFunc, userData, destroy);
136 }
137
138 -(void)setHeaderFuncWithUpdateHeader:(GtkListBoxUpdateHeaderFunc) updateHeader andUserData:(gpointer) userData andDestroy:(GDestroyNotify) destroy
139 {
140 gtk_list_box_set_header_func(GTK_LIST_BOX([self GOBJECT]), updateHeader, userData, destroy);
141 }
142
143 -(void)setPlaceholder:(CGTKWidget*) placeholder
144 {
145 gtk_list_box_set_placeholder(GTK_LIST_BOX([self GOBJECT]), [placeholder WIDGET]);
146 }
147
148 -(void)setSelectionMode:(GtkSelectionMode) mode
149 {
150 gtk_list_box_set_selection_mode(GTK_LIST_BOX([self GOBJECT]), mode);
151 }
152
153 -(void)setSortFuncWithSortFunc:(GtkListBoxSortFunc) sortFunc andUserData:(gpointer) userData andDestroy:(GDestroyNotify) destroy
154 {
155 gtk_list_box_set_sort_func(GTK_LIST_BOX([self GOBJECT]), sortFunc, userData, destroy);
156 }
157
158
159 @end
-[CGTKListBox invalidateSort]
void invalidateSort()
Definition: CGTKListBox.m:108
-[CGTKListBox invalidateHeaders]
void invalidateHeaders()
Definition: CGTKListBox.m:103
-[CGTKBase GOBJECT]
GObject * GOBJECT()
Definition: CGTKBase.m:82
-[CGTKListBox getActivateOnSingleClick]
BOOL getActivateOnSingleClick()
Definition: CGTKListBox.m:63
-[CGTKBase initWithGObject:]
id initWithGObject:(GObject *obj)
Definition: CGTKBase.m:48
-[CGTKListBox dragUnhighlightRow]
void dragUnhighlightRow()
Definition: CGTKListBox.m:58
-[CGTKWidget destroy]
void destroy()
Definition: CGTKWidget.m:131
-[CGTKWidget WIDGET]
GtkWidget * WIDGET()
Definition: CGTKWidget.m:61
-[CGTKListBox getSelectionMode]
GtkSelectionMode getSelectionMode()
Definition: CGTKListBox.m:88
-[CGTKListBox invalidateFilter]
void invalidateFilter()
Definition: CGTKListBox.m:98
-[CGTKListBox getAdjustment]
GtkAdjustment * getAdjustment()
Definition: CGTKListBox.m:68
-[CGTKListBox init]
id init()
Definition: CGTKListBox.m:36
CGTKWidget
Definition: CGTKWidget.h:34
-[CGTKListBox LISTBOX]
GtkListBox * LISTBOX()
Definition: CGTKListBox.m:48
-[CGTKListBox getSelectedRow]
GtkListBoxRow * getSelectedRow()
Definition: CGTKListBox.m:83
CGTKListBox
Definition: CGTKListBox.h:34