31 lines
1.3 KiB
C
31 lines
1.3 KiB
C
#ifndef __COLBEN_LIST__
|
|
#define __COLBEN_LIST__
|
|
|
|
#include <gtk/gtk.h>
|
|
#define NORMAL_COLOR "black" //非选中颜色
|
|
#define HIGH_COLOR "white" //选中颜色
|
|
|
|
typedef struct //list句柄
|
|
{
|
|
gint total; //标签总数量
|
|
gint tab_show; //标签显示数量
|
|
gint tab_width; //标签宽度
|
|
gint tab_height; //标签高度
|
|
gint tab_select; //当前选中标签
|
|
gpointer out; //双击事件回调参数
|
|
GtkWidget *event_box; //底层事件盒子,需手动添加到自定义布局中
|
|
GtkWidget *fixed_bottom; //中层固定布局
|
|
GtkWidget *fixed_top; //上层固定布局
|
|
GtkWidget **label; //每一行的信息
|
|
}LIST;
|
|
|
|
extern LIST *cgtk_list_new(char **,int,int,int,gpointer); //创建列表,需指定指针数组,列表宽度,单行高度,双击回调参数指针
|
|
extern int cgtk_list_refresh(LIST *,char **); //刷新列表,需指定列表和新指针数组,双击回调参数指针
|
|
extern int cgtk_list_set_select_num(LIST *,int); //设置选中行号
|
|
extern int cgtk_list_get_select_num(LIST *); //获取选中行号
|
|
extern char *cgtk_list_get_select_text(LIST *); //获取选中行文本
|
|
extern void cgtk_list_destroy(LIST *); //释放列表内存空间
|
|
extern void list_select_back(gpointer); //双击事件回调,需外部实现
|
|
|
|
#endif
|