Gtk+常用构件
标签
GtkWidget* gtk_label_new(const char *str);
void gtk_label_set_text(GtkLabel *label, const char* str);
const gchar* gtk_label_get_text(GtkLabel *label);
列表
GtkWidget* gtk_list_new();
void gtk_list_set_selection_mode(GtkList * list, GtkSelectionMode mode)
GTK_SELECTION_SINGLE 默认
GTK_SELECTION_BROWSE 必须选择一项
GTK_SELECTION_MULTIPLE可选多个不连续的项
GTK_SELECTION_EXTENDED可连续选择多个项
GtkWidget * gtk_list_item_new_with_label(const gchar* label)
void gtk_list_clear_items(GtkList *list, gint start, gint end);0-n -
编辑框
GtkWidget* gtk_entry_new(void);
GtkWidget* gtk_entry_new_with_max_length(gint max);
void gtk_entry_set_text(GtkEntry *entry, const gchar *text);
const gchar* gtk_entry_get_text(GtkEntry *entry);
void gtk_entry_set_visibility(GtkEntry *entry, gboolean visible);
void gtk_editable_set_editable(GtkEditable *editable, gboolean is_editable);
回调函数事件:insert_text delete_text changed active set_text
组合框
GtkWidget *gtk_combo_new();
void gtk_combo_set_popdown_strings(GtkCombo *combo, GList *string);
typedef struct {
gpointer data;
GList *next;
GList *prev;}GList;
GList * g_list_append(GList *list,gpointer data);
框架
GtkWidget * gtk_frame_new(const gchar * label);
void gtk_frame_set_label(GtkFrame *frame, const gchar* label);
void gtk_frame_set_label_align(GtkFrame *frame,float xalign,gfloat yalign);0.0-1.0
进度条
GtkWidget * gtk_progress_bar_new();
void gtk_progress_bar_set_fraction(GtkProcessBar *pbar, gdouble fraction); 0-1
void gtk_progress_bar_set_orientation(GtkProcessBar *pbar, GtkProgressBarOrientation o);
typdef enum{
GTK_PROGRESS_LEFT_TO_RIGTHT,
GTK_PROGRESS_RIGHT_TO_LEFT,
GTK_PROGRESS_BOTTOM_TO_TOP,
GTK_PROGRESS_TOP_TO_BOTTOM}GtkProgressBarOrientation;
void gtk_progress_bar_set_text(GtkProgressBar *pbar, const gchar *text);
guint g_timeout_add(guint inteval,GSourceFunc function ,gpointer data);ms
gboolean g_source_remove(guint tag);
阅读(1011) | 评论(0) | 转发(0) |