File: gblist.c

package info (click to toggle)
mc 4.1.35-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 6,924 kB
  • ctags: 9,665
  • sloc: ansic: 84,273; tcl: 1,779; makefile: 1,266; sh: 864; perl: 262; awk: 148; sed: 93; csh: 1
file content (68 lines) | stat: -rw-r--r-- 1,406 bytes parent folder | download | duplicates (2)
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
/*
 * gblist:  Implements a GtkCList derived widget that does not take any action
 *          on select and unselect calls.
 *
 * Author: Miguel de Icaza (miguel@kernel.org)
 * (C) 1998 the Free Software Foundation.
 */
#include <stdlib.h>
#include "config.h"
#include "gblist.h"

static void
blist_select_row (GtkCList *clist, gint row, gint column, GdkEventButton *event)
{
	/* nothing */
}

static void
blist_unselect_row (GtkCList *clist, gint row, gint column, GdkEventButton *event)
{
	/* nothing */
}

static void
gtk_blist_class_init (GtkBListClass *klass)
{
	GtkCListClass *clist_class = (GtkCListClass *) klass;

	clist_class->select_row   = blist_select_row;
	clist_class->unselect_row = blist_unselect_row;
}

GtkType
gtk_blist_get_type (void)
{
	static GtkType blist_type = 0;
	
	if (!blist_type){
		GtkTypeInfo blist_info =
		{
			"GtkBList",
			sizeof (GtkBList),
			sizeof (GtkBListClass),
			(GtkClassInitFunc) gtk_blist_class_init,
			(GtkObjectInitFunc) NULL,
			(GtkArgSetFunc) NULL,
			(GtkArgGetFunc) NULL,
		};
		
		blist_type = gtk_type_unique (gtk_clist_get_type (), &blist_info);
	}
	
	return blist_type;
}

GtkWidget *
gtk_blist_new_with_titles (gint columns, gchar * titles[])
{
	GtkWidget *widget;

	g_return_val_if_fail (titles != NULL, NULL);
	
	widget = gtk_type_new (gtk_blist_get_type ());
	
	gtk_clist_construct (GTK_CLIST (widget), columns, titles);
	
	return widget;
}