⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 combobox.c

📁 开发linux应用-用gtk+和gdk开发linux图形用户界面应用--的实例
💻 C
字号:
/* * File: combobox.c * Auth: Eric Harlow *  * Routine to put up a font combobox. */#include <gtk/gtk.h>/* * CreateCombobox * * Create a drop down combobox with a few items in it. */GtkWidget *CreateCombobox (){    GList *cbitems = NULL;    GtkWidget *combo;    /*      * --- Create a list of the items first     */     cbitems = g_list_append (cbitems, "Arial");    cbitems = g_list_append (cbitems, "Times Roman");    cbitems = g_list_append (cbitems, "Wing Dings");    cbitems = g_list_append (cbitems, "Sandscript");    /* --- Make a combo box. --- */    combo = gtk_combo_new ();    /* --- Create the drop down portion of the combo --- */    gtk_combo_set_popdown_strings (GTK_COMBO(combo), cbitems);    /* --- Default the text in the field to a value --- */    gtk_entry_set_text (GTK_ENTRY (GTK_COMBO(combo)->entry), "Arial");    /* --- Make the edit portion non-editable.  They can pick a      *     value from the drop down, they just can't end up with     *     a value that's not in the drop down.     */    gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (combo)->entry), FALSE);    /* --- Make it visible --- */    gtk_widget_show (combo);    return (combo);}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -