本文整理汇总了C++中GTK_CLIST函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_CLIST函数的具体用法?C++ GTK_CLIST怎么用?C++ GTK_CLIST使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GTK_CLIST函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: clist_selected
static void clist_selected(GtkWidget *widget, gint row, gint column,
GdkEventButton *event, gpointer data)
{
int connect_sensitive = 0;
int disconnect_sensitive = 0;
int forget_sensitive = 0;
int verify_sensitive = 0;
Fingerprint *f = gtk_clist_get_row_data(GTK_CLIST(ui_layout.keylist),
row);
ConnContext *context_iter;
if (f) {
verify_sensitive = 1;
forget_sensitive = 1;
if (f->context && f->context->m_context) {
for (context_iter = f->context;
context_iter && context_iter->m_context ==
f->context->m_context;
context_iter = context_iter->next) {
if (context_iter->msgstate == OTRL_MSGSTATE_ENCRYPTED &&
context_iter->active_fingerprint == f) {
disconnect_sensitive = 1;
forget_sensitive = 0;
}
else if (context_iter->msgstate == OTRL_MSGSTATE_FINISHED) {
disconnect_sensitive = 1;
connect_sensitive = 1;
}
else if (context_iter->msgstate == OTRL_MSGSTATE_PLAINTEXT) {
connect_sensitive = 1;
}
}
}
}
gtk_widget_set_sensitive(ui_layout.connect_button,
connect_sensitive);
gtk_widget_set_sensitive(ui_layout.disconnect_button,
disconnect_sensitive);
gtk_widget_set_sensitive(ui_layout.forget_button, forget_sensitive);
gtk_widget_set_sensitive(ui_layout.verify_button, verify_sensitive);
ui_layout.selected_fprint = f;
}
开发者ID:N8Fear,项目名称:pidgin-otr,代码行数:45,代码来源:gtk-ui.c
示例2: add_filter_callback_2
static void add_filter_callback_2(GtkWidget *widget, GtkWidget *nothing)
{
int i;
GtkCList *cl;
if(!GLOBALS->filesel_ok) { return; }
if(*GLOBALS->fileselbox_text)
{
for(i=0;i<GLOBALS->num_ttrans_filters;i++)
{
if(GLOBALS->ttranssel_filter[i])
{
if(!strcmp(GLOBALS->ttranssel_filter[i], *GLOBALS->fileselbox_text))
{
status_text("Filter already imported.\n");
if(GLOBALS->is_active_ttranslate_c_2) gdk_window_raise(GLOBALS->window_ttranslate_c_5->window);
return;
}
}
}
}
GLOBALS->num_ttrans_filters++;
load_ttrans_filter(GLOBALS->num_ttrans_filters, *GLOBALS->fileselbox_text);
if(GLOBALS->ttrans_filter[GLOBALS->num_ttrans_filters])
{
if(GLOBALS->ttranssel_filter[GLOBALS->num_ttrans_filters]) free_2(GLOBALS->ttranssel_filter[GLOBALS->num_ttrans_filters]);
GLOBALS->ttranssel_filter[GLOBALS->num_ttrans_filters] = malloc_2(strlen(*GLOBALS->fileselbox_text) + 1);
strcpy(GLOBALS->ttranssel_filter[GLOBALS->num_ttrans_filters], *GLOBALS->fileselbox_text);
cl=GTK_CLIST(GLOBALS->clist_ttranslate_c_2);
gtk_clist_freeze(cl);
gtk_clist_append(cl,(gchar **)&(GLOBALS->ttranssel_filter[GLOBALS->num_ttrans_filters]));
gtk_clist_set_column_width(cl,0,gtk_clist_optimal_column_width(cl,0));
gtk_clist_thaw(cl);
}
else
{
GLOBALS->num_ttrans_filters--;
}
if(GLOBALS->is_active_ttranslate_c_2) gdk_window_raise(GLOBALS->window_ttranslate_c_5->window);
}
开发者ID:Pidbip,项目名称:egtkwave,代码行数:45,代码来源:ttranslate.c
示例3: gradient_select_rename_all
void
gradient_select_rename_all (gradient_t *gradient)
{
GradientSelect *gsp;
GSList *list;
gint row;
for (list = gradient_active_dialogs; list; list = g_slist_next (list))
{
gsp = (GradientSelect *) list->data;
row = gtk_clist_find_row_from_data (GTK_CLIST (gsp->clist), gradient);
/*
if (row > -1)
gtk_clist_set_text (GTK_CLIST (gsp->clist), row, 1, gradient->name);
*/
}
}
开发者ID:VisualIdeation,项目名称:vis5d--1.3.1,代码行数:18,代码来源:gradient_select.c
示例4: imp_ldif_modify_pressed
static void imp_ldif_modify_pressed( GtkWidget *widget, gpointer data ) {
GtkCList *clist = GTK_CLIST(impldif_dlg.clist_field);
Ldif_FieldRec *rec;
gint row;
if( impldif_dlg.rowIndSelect < 0 ) return;
row = impldif_dlg.rowIndSelect;
rec = gtk_clist_get_row_data( clist, impldif_dlg.rowIndSelect );
g_free( rec->userName );
rec->userName = gtk_editable_get_chars( GTK_EDITABLE(impldif_dlg.name_attrib), 0, -1 );
rec->selected = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( impldif_dlg.check_select) );
imp_ldif_update_row( clist );
gtk_clist_select_row( clist, row, 0 );
gtk_label_set_text( GTK_LABEL(impldif_dlg.name_ldif), "" );
gtk_entry_set_text( GTK_ENTRY(impldif_dlg.name_attrib), "" );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( impldif_dlg.check_select), FALSE );
}
开发者ID:ChakaZulu,项目名称:sylpheed_upstream,代码行数:18,代码来源:importldif.c
示例5: GTK_CLIST
GtkWidget *gtk_clist_new(gint columns)
{
GtkCList *clist;
int i;
clist = GTK_CLIST(GtkNewObject(&GtkCListClass));
clist->cols = columns;
clist->coldata = g_new0(GtkCListColumn, columns);
clist->rows = 0;
clist->rowdata = NULL;
for (i = 0; i < columns; i++) {
clist->coldata[i].width = 0;
clist->coldata[i].visible = TRUE;
clist->coldata[i].resizeable = TRUE;
}
return GTK_WIDGET(clist);
}
开发者ID:CraneMTG,项目名称:ScrapWars-2,代码行数:18,代码来源:clist.c
示例6: on_rule_new_rule_clicked
void
on_rule_new_rule_clicked (GtkButton * button, gpointer UNUSED(user_data))
{
rule *r;
int x;
GtkCList *clist;
r = (rule *) malloc (sizeof (rule));
r->regex = g_strdup ("");
r->mbox = g_strdup ("Inbox");
r->name = g_strdup ("New rule");
r->piece = g_strdup ("Header");
clist = GTK_CLIST (lookup_widget (GTK_WIDGET (button), "clist1"));
x = clist->rows;
gtk_clist_insert (clist, x, &(r->name));
gtk_clist_set_row_data (clist, x, r);
gtk_clist_select_row (clist, x, 0);
}
开发者ID:erikg,项目名称:GEMS,代码行数:18,代码来源:callbacks.c
示例7: nodes_gui_update_node_info
/**
* Update the row with the given nodeinfo. If row is -1 the row number
* is determined by the node_id contained in the gnet_node_info_t.
*/
static void
nodes_gui_update_node_info(gnet_node_info_t *n, gint row)
{
GtkCList *clist = GTK_CLIST(gui_main_window_lookup("clist_nodes"));
g_assert(n != NULL);
if (row == -1) {
row = gtk_clist_find_row_from_data(clist,
deconstify_gpointer(n->node_id));
}
if (row != -1) {
gchar ver_buf[64];
gnet_node_status_t status;
time_t now = tm_time();
if (guc_node_get_status(n->node_id, &status)) {
gtk_clist_set_text(clist, row, c_gnet_user_agent,
n->vendor ? lazy_utf8_to_locale(n->vendor) : "...");
gtk_clist_set_text(clist, row, c_gnet_loc,
deconstify_gchar(iso3166_country_cc(n->country)));
str_bprintf(ver_buf, sizeof ver_buf, "%d.%d",
n->proto_major, n->proto_minor);
gtk_clist_set_text(clist, row, c_gnet_version, ver_buf);
if (status.status == GTA_NODE_CONNECTED)
gtk_clist_set_text(clist, row, c_gnet_connected,
short_uptime(delta_time(now, status.connect_date)));
if (status.up_date)
gtk_clist_set_text(clist, row, c_gnet_uptime,
status.up_date
? short_uptime(delta_time(now, status.up_date)) : "...");
gtk_clist_set_text(clist, row, c_gnet_info,
nodes_gui_common_status_str(&status));
}
} else {
g_warning("%s(): no matching row found", G_STRFUNC);
}
}
开发者ID:Longdengyu,项目名称:gtk-gnutella,代码行数:48,代码来源:nodes.c
示例8: widget_table_input_by_command
static void widget_table_input_by_command(variable *var, char *filename,
gint command_or_file)
{
FILE *infile;
gchar line[512];
gint count;
list_t *sliced;
#ifdef DEBUG_TRANSITS
fprintf(stderr, "%s(): Entering.\n", __func__);
#endif
#if !GTK_CHECK_VERSION(3,0,0) /* gtk3: Deprecated in gtk2 and now gone */
if (command_or_file) {
infile = widget_opencommand(filename);
} else {
infile = fopen(filename, "r");
}
/* Opening pipe for reading... */
if (infile) {
/* Read the file one line at a time (trailing [CR]LFs are read too) */
while (fgets(line, 512, infile) != NULL) {
/* Enforce end of string in case of max chars read */
line[512 - 1] = 0;
/* Remove the trailing [CR]LFs */
for (count = strlen(line) - 1; count >= 0; count--)
if (line[count] == 13 || line[count] == 10) line[count] = 0;
sliced = linecutter(g_strdup(line), '|');
gtk_clist_append(GTK_CLIST(var->Widget), sliced->line);
if (sliced) list_t_free(sliced); /* Free linecutter memory */
}
/* Close the file */
pclose(infile);
} else {
fprintf(stderr, "%s(): Couldn't open '%s' for reading.\n", __func__,
filename);
}
#endif
#ifdef DEBUG_TRANSITS
fprintf(stderr, "%s(): Exiting.\n", __func__);
#endif
}
开发者ID:ElAdnan,项目名称:gtkdialog,代码行数:44,代码来源:widget_table.c
示例9: update_row
static void
update_row (int row,
XSettingsSetting *setting)
{
char buffer[256];
GtkStyle *style;
const char *type;
if (setting->type != XSETTINGS_TYPE_COLOR)
gtk_clist_set_cell_style (GTK_CLIST (settings_clist),
row, VALUE, NULL);
switch (setting->type)
{
case XSETTINGS_TYPE_INT:
type = "INT";
sprintf (buffer, "%d", setting->data.v_int);
gtk_clist_set_text (GTK_CLIST (settings_clist), row, VALUE, buffer);
break;
case XSETTINGS_TYPE_STRING:
type = "STRING";
gtk_clist_set_text (GTK_CLIST (settings_clist), row, VALUE, setting->data.v_string);
break;
case XSETTINGS_TYPE_COLOR:
type = "COLOR";
gtk_clist_set_text (GTK_CLIST (settings_clist), row, VALUE, "");
style = gtk_style_copy (settings_clist->style);
style->base[GTK_STATE_NORMAL].red = setting->data.v_color.red;
style->base[GTK_STATE_NORMAL].green = setting->data.v_color.green;
style->base[GTK_STATE_NORMAL].blue = setting->data.v_color.blue;
style->bg[GTK_STATE_SELECTED].red = setting->data.v_color.red;
style->bg[GTK_STATE_SELECTED].green = setting->data.v_color.green;
style->bg[GTK_STATE_SELECTED].blue = setting->data.v_color.blue;
gtk_clist_set_cell_style (GTK_CLIST (settings_clist),
row, VALUE, style);
gtk_style_unref (style);
break;
default:
g_assert_not_reached ();
}
gtk_clist_set_text (GTK_CLIST (settings_clist), row, TYPE, type);
sprintf (buffer, "%ld", setting->last_change_serial);
gtk_clist_set_text (GTK_CLIST (settings_clist), row, SERIAL, buffer);
}
开发者ID:freedesktop-unofficial-mirror,项目名称:xdg__xdg-specs,代码行数:46,代码来源:client.c
示例10: eqSetChannelNames
static void eqSetChannelNames( void )
{
gchar * str[2];
gtk_clist_clear( GTK_CLIST( ChannelsList ) );
str[1]="";
str[0]=MSGTR_EQU_All;
gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
if ( guiIntfStruct.AudioType > 1 )
{
str[0]=gtkEquChannel1; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
str[0]=gtkEquChannel2; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
}
if ( guiIntfStruct.AudioType > 2 )
{
str[0]=gtkEquChannel3; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
str[0]=gtkEquChannel4; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
}
if ( guiIntfStruct.AudioType > 4 )
{
str[0]=gtkEquChannel5; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
str[0]=gtkEquChannel6; gtk_clist_append( GTK_CLIST( ChannelsList ) ,str);
}
gtk_clist_select_row( GTK_CLIST( ChannelsList ),0,0 );
}
开发者ID:AlbertoBarraja,项目名称:svc_dash,代码行数:24,代码来源:eq.c
示例11: gnc_query_list_toggle
static void
gnc_query_list_toggle (GNCQueryList *list)
{
gpointer entry;
gint row;
g_return_if_fail (IS_GNC_QUERY_LIST(list));
if (list->no_toggle)
return;
row = list->current_row;
entry = gtk_clist_get_row_data (GTK_CLIST(list), row);
list->current_entry = entry;
g_signal_emit (list, query_list_signals[LINE_TOGGLED], 0, entry);
update_booleans (list, row);
}
开发者ID:nishmu,项目名称:gnucash,代码行数:19,代码来源:gnc-query-list.c
示例12: gnc_query_list_column_title
static void
gnc_query_list_column_title (GNCQueryList *list, gint column, const gchar *title)
{
GtkWidget *hbox, *label, *arrow;
hbox = gtk_hbox_new(FALSE, 2);
gtk_widget_show(hbox);
gtk_clist_set_column_widget(GTK_CLIST(list), column, hbox);
label = gtk_label_new(title);
gtk_widget_show(label);
gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
arrow = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_ETCHED_IN);
list->title_arrows[column] = arrow;
if (column == 0)
gtk_widget_show(arrow);
gtk_box_pack_end(GTK_BOX(hbox), arrow, FALSE, FALSE, 0);
}
开发者ID:nishmu,项目名称:gnucash,代码行数:19,代码来源:gnc-query-list.c
示例13: on_button_uploads_kill_clicked
void
on_button_uploads_kill_clicked(GtkButton *unused_button, gpointer unused_udata)
{
GSList *sl = NULL;
GtkCList *clist;
(void) unused_button;
(void) unused_udata;
clist = GTK_CLIST(gui_main_window_lookup("clist_uploads"));
gtk_clist_freeze(clist);
sl = clist_collect_data(clist, FALSE, NULL);
g_slist_foreach(sl, kill_upload, NULL);
g_slist_free(sl);
gtk_clist_thaw(clist);
}
开发者ID:luciomarinelli,项目名称:gtk-gnutella,代码行数:19,代码来源:uploads_cb.c
示例14: _
GtkWidget *create_source_ctree (GtkWidget *scrollwin) {
char *titles[1] = { _("Source") };
GtkWidget *ctree;
/* gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrollwin), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
*/
ctree = gtk_ctree_new_with_titles (1, 0, titles);
gtk_container_add (GTK_CONTAINER (scrollwin), ctree);
gtk_clist_set_selection_mode (GTK_CLIST (ctree), GTK_SELECTION_EXTENDED);
gtk_ctree_set_line_style (GTK_CTREE (ctree), GTK_CTREE_LINES_NONE);
gtk_ctree_set_expander_style (GTK_CTREE (ctree), GTK_CTREE_EXPANDER_TRIANGLE);
gtk_ctree_set_indent (GTK_CTREE (ctree), 10);
fill_source_ctree (ctree);
return ctree;
}
开发者ID:IR4T4,项目名称:xqf,代码行数:19,代码来源:xqf-ui.c
示例15: find_row
static int
find_row (const char *name)
{
GList *tmp_list = GTK_CLIST (settings_clist)->row_list;
int index = 0;
while (tmp_list)
{
GtkCListRow *row = GTK_CLIST_ROW (tmp_list);
if (strcmp (row->data, name) == 0)
return index;
tmp_list = tmp_list->next;
index++;
}
return -1;
}
开发者ID:freedesktop-unofficial-mirror,项目名称:xdg__xdg-specs,代码行数:19,代码来源:client.c
示例16: on_main_popup_delete_activate
void on_main_popup_delete_activate(GtkMenuItem * menuitem, gpointer user_data)
{
gint row, col;
popup_info_t *info;
fprintf( stderr, "on_main_popup_delete_activate\n" );
if (info = (popup_info_t *) user_data)
{
gtk_clist_get_selection_info(GTK_CLIST(main_clist),
info->x, info->y, &row, &col);
//printf("bloa! (x %d y %d is row %d col %d)\n");
}
else
printf("%s",
_("Oops. NULL info in on_main_popup_delete_activate\n"));
}
开发者ID:shixudongleo,项目名称:spark_for_dpm,代码行数:19,代码来源:callbacks.cpp
示例17: add_selected_to_playlist_and_play
void add_selected_to_playlist_and_play(void) {
int i;
int playnow = 1;
for(i=0; i<row_count; i++) {
struct entry *d =
(struct entry*)gtk_clist_get_row_data(GTK_CLIST(file_list), i);
if( d->selected ) {
if (!playnow) add_to_playlist(i);
else {
playnow = 0;
add_to_playlist_and_play(i);
}
}
}
}
开发者ID:BackupTheBerlios,项目名称:beepmedialib-svn,代码行数:19,代码来源:gui_playlist.c
示例18: add_to_playlist
void add_to_playlist(gint row)
{
DEBUG_MSG("add_to_playlist");
gchar *text;
GList *list = NULL;
struct entry *d = ((struct entry*) gtk_clist_get_row_data(GTK_CLIST(file_list),row));
if( d == NULL ) {
DEBUG_MSG("WRONG\n");
return;
}
text = d->filename;
list = g_list_append(list, text);
xmms_remote_playlist_add(cue_gp.xmms_session, list);
DEBUG_MSG("add_to_playlist finished");
}
开发者ID:BackupTheBerlios,项目名称:beepmedialib-svn,代码行数:19,代码来源:gui_playlist.c
示例19: key_dialog_sel_row
static void
key_dialog_sel_row (GtkWidget * clist, gint row, gint column,
GdkEventButton * evt, gpointer data)
{
struct key_binding *kb = gtk_clist_get_row_data (GTK_CLIST (clist), row);
if (kb == NULL)
{
printf ("*** key_dialog_sel_row: kb == NULL\n");
abort ();
}
if (kb->action > -1 && kb->action <= KEY_MAX_ACTIONS)
{
gtk_option_menu_set_history (GTK_OPTION_MENU (key_dialog_act_menu),
kb->action);
if (key_actions[kb->action].help)
{
key_print_text (GTK_XTEXT (key_dialog_text), _(key_actions[kb->action].help));
}
}
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (key_dialog_tog_c),
(kb->mod & STATE_CTRL) == STATE_CTRL);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (key_dialog_tog_s),
(kb->mod & STATE_SHIFT) == STATE_SHIFT);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (key_dialog_tog_a),
(kb->mod & STATE_ALT) == STATE_ALT);
if (kb->data1)
gtk_entry_set_text (GTK_ENTRY (key_dialog_ent_d1), kb->data1);
else
gtk_entry_set_text (GTK_ENTRY (key_dialog_ent_d1), "");
if (kb->data2)
gtk_entry_set_text (GTK_ENTRY (key_dialog_ent_d2), kb->data2);
else
gtk_entry_set_text (GTK_ENTRY (key_dialog_ent_d2), "");
if (kb->keyname)
gtk_entry_set_text (GTK_ENTRY (key_dialog_ent_key), kb->keyname);
else
gtk_entry_set_text (GTK_ENTRY (key_dialog_ent_key), "");
}
开发者ID:n2i,项目名称:xvnkb,代码行数:42,代码来源:fkeys.c
示例20: url_opengui
void
url_opengui ()
{
GtkWidget *vbox, *hbox;
GSList *list;
if (urlgrabberwindow)
{
wins_bring_tofront (urlgrabberwindow);
return;
}
urlgrabberwindow =
maingui_window ("urlgrabber", _("X-Chat: URL Grabber"), FALSE, TRUE,
url_closegui, NULL, 350, 100, &urlgrabberwindow);
vbox = wins_get_vbox (urlgrabberwindow);
urlgrabberlist = gtkutil_clist_new (1, 0, vbox, GTK_POLICY_AUTOMATIC,
0, 0, 0, 0, GTK_SELECTION_BROWSE);
gtk_signal_connect (GTK_OBJECT (urlgrabberlist), "button_press_event",
GTK_SIGNAL_FUNC (url_clicklist), 0);
gtk_widget_set_usize (urlgrabberlist, 350, 0);
gtk_clist_set_column_width (GTK_CLIST (urlgrabberlist), 0, 100);
hbox = gtk_hbox_new (FALSE, 1);
gtk_box_pack_end (GTK_BOX (vbox), hbox, FALSE, FALSE, 2);
gtk_widget_show (hbox);
gtkutil_button (urlgrabberwindow, GNOME_STOCK_PIXMAP_CLEAR,
_("Clear"), url_button_clear, 0, hbox);
gtkutil_button (urlgrabberwindow, GNOME_STOCK_PIXMAP_SAVE,
_("Save"), url_button_save, 0, hbox);
gtk_widget_show (urlgrabberwindow);
list = url_list;
while (list)
{
url_addurlgui ((char *) list->data);
list = list->next;
}
}
开发者ID:UIKit0,项目名称:picogui,代码行数:42,代码来源:urlgrab.c
注:本文中的GTK_CLIST函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论