本文整理汇总了C++中GTK_CTREE函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_CTREE函数的具体用法?C++ GTK_CTREE怎么用?C++ GTK_CTREE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GTK_CTREE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: remove_file_transfer
void
remove_file_transfer (gpointer data)
{
gftpui_common_curtrans_data * transdata;
GtkCTreeNode * node;
gftp_file * curfle;
if (GTK_CLIST (dlwdw)->selection == NULL)
{
ftp_log (gftp_logging_error, NULL,
_("There are no file transfers selected\n"));
return;
}
node = GTK_CLIST (dlwdw)->selection->data;
transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node);
if (transdata->curfle == NULL || transdata->curfle->data == NULL)
return;
curfle = transdata->curfle->data;
gftpui_common_skip_file_transfer (transdata->transfer, curfle);
gtk_ctree_node_set_text (GTK_CTREE (dlwdw), curfle->user_data, 1,
_("Skipped"));
}
示例2: source_ctree_add_master
void source_ctree_add_master (GtkWidget *ctree, struct master *m) {
GtkCTreeNode *node;
GtkCTreeNode *parent = NULL;
struct master *group = NULL;
if (m->isgroup)
return;
// If set to display only configured games, and game is not configured,
// and it's not the 'Favorites' master, just return so the display
// isn't updated with the game type and masters.
if (!(games[m->type].cmd) && default_show_only_configured_games && m != favorites)
return;
if (m->type != UNKNOWN_SERVER) {
group = (struct master *) g_slist_nth_data (master_groups, m->type);
source_ctree_enable_master_group (ctree, group, TRUE);
}
node = gtk_ctree_find_by_row_data (GTK_CTREE (ctree), NULL, m);
if (!node) {
if (group) {
parent = gtk_ctree_find_by_row_data (GTK_CTREE (ctree), NULL, group);
}
node = gtk_ctree_insert_node (GTK_CTREE (ctree), parent, NULL, NULL, 4, NULL, NULL, NULL, NULL, TRUE, FALSE);
gtk_ctree_node_set_row_data (GTK_CTREE (ctree), node, m);
}
source_ctree_show_node_status (ctree, m);
}
示例3: ssl_manager_delete_cb
static void ssl_manager_delete_cb(GtkWidget *widget,
gpointer data)
{
SSLCertificate *cert;
GList *rowlist;
int val;
rowlist = GTK_CLIST(manager.certlist)->selection;
if (!rowlist)
return;
cert = gtk_ctree_node_get_row_data
(GTK_CTREE(manager.certlist),
GTK_CTREE_NODE(rowlist->data));
if (!cert)
return;
val = alertpanel(_("Delete certificate"),
_("Do you really want to delete this certificate?"),
_("Yes"), _("+No"), NULL);
if (val != G_ALERTDEFAULT)
return;
ssl_certificate_delete_from_disk(cert);
ssl_certificate_destroy(cert);
gtk_ctree_remove_node(GTK_CTREE(manager.certlist), GTK_CTREE_NODE(rowlist->data));
}
示例4: dirtree_refresh_node
void
dirtree_refresh_node (DirTree * dt, GtkCTreeNode * node)
{
DirTreeNode *dirnode = NULL;
gint has_subdirs;
gboolean expanded;
dirnode = gtk_ctree_node_get_row_data (GTK_CTREE (dt), node);
has_subdirs = tree_is_subdirs (dirnode->path, dt->show_dotfile);
if (has_subdirs && GTK_CTREE_ROW (node)->expanded == 1)
expanded = TRUE;
else
expanded = FALSE;
if (has_subdirs)
gtk_ctree_set_node_info (GTK_CTREE (dt), node,
g_basename (dirnode->path), CTREE_SPACING,
folder_pixmap, folder_mask, ofolder_pixmap,
ofolder_mask, FALSE, expanded);
else
gtk_ctree_set_node_info (GTK_CTREE (dt), node,
g_basename (dirnode->path), CTREE_SPACING,
folder_pixmap, folder_mask, ofolder_pixmap,
ofolder_mask, TRUE, expanded);
}
示例5: fill_source_ctree
static void fill_source_ctree (GtkWidget *ctree) {
GSList *list;
GSList *list2;
GtkCTreeNode *node;
GtkCTreeNode *parent;
struct master *group;
struct master *m;
source_ctree_add_master (ctree, favorites);
for (list = master_groups; list; list = list->next) {
group = (struct master *) list->data;
if (group->masters) {
// If set to display only configured games, and game is not configured,
// don't update the display with the master.
if (games[group->type].cmd || !default_show_only_configured_games) {
source_ctree_enable_master_group (ctree, group, FALSE);
parent = gtk_ctree_find_by_row_data (GTK_CTREE (ctree), NULL, group);
for (list2 = group->masters; list2; list2 = list2->next) {
m = (struct master *) list2->data;
node = gtk_ctree_insert_node (GTK_CTREE (ctree), parent, NULL, NULL, 4, NULL, NULL, NULL, NULL, TRUE, FALSE);
gtk_ctree_node_set_row_data (GTK_CTREE (ctree), node, m);
source_ctree_show_node_status (ctree, m);
}
}
}
}
}
示例6: gftpui_add_file_to_transfer
void
gftpui_add_file_to_transfer (gftp_transfer * tdata, GList * curfle)
{
gftpui_common_curtrans_data * transdata;
char *text[2];
gftp_file * fle;
fle = curfle->data;
text[0] = gftpui_gtk_get_utf8_file_pos (fle);
if (fle->transfer_action == GFTP_TRANS_ACTION_SKIP)
text[1] = _("Skipped");
else
text[1] = _("Waiting...");
fle->user_data = gtk_ctree_insert_node (GTK_CTREE (dlwdw),
tdata->user_data, NULL, text, 5,
NULL, NULL, NULL, NULL,
FALSE, FALSE);
transdata = g_malloc0 (sizeof (*transdata));
transdata->transfer = tdata;
transdata->curfle = curfle;
gtk_ctree_node_set_row_data (GTK_CTREE (dlwdw), fle->user_data, transdata);
}
示例7: gdisp_popupMenuHandler
/*
* Popup Menu Handler.
* Expand or Collapse the whole hierarchical tree.
*/
static void
gdisp_popupMenuHandler ( Kernel_T *kernel,
PopupMenu_T *menu,
gpointer menuData, /* cTree */
gpointer itemData )
{
GtkWidget *cTree = (GtkWidget*)menuData;
guint action = GPOINTER_TO_UINT(itemData);
/*
* itemData : 0-collapse, 1-expand
*/
if (action == 1 /* expand */) {
gtk_ctree_expand_recursive(GTK_CTREE(cTree),
(GtkCTreeNode*)NULL);
}
else {
gtk_ctree_collapse_recursive(GTK_CTREE(cTree),
(GtkCTreeNode*)NULL);
}
}
示例8: icon_selected
static void icon_selected (MimeView *mimeview, gint num, MimeInfo *partinfo)
{
GtkCTreeNode *node;
node = gtk_ctree_find_by_row_data(GTK_CTREE(mimeview->ctree), NULL, partinfo);
if (node)
gtk_ctree_select(GTK_CTREE(mimeview->ctree), node);
}
示例9: switch
GtkWidget *create_cwidget (GtkWidget *scrollwin, struct clist_def *cldef) {
GtkWidget *alignment;
GtkWidget *label;
GtkWidget *clist;
char buf[256];
int i;
switch (cldef->type) {
case CWIDGET_CLIST:
clist = gtk_clist_new (cldef->columns);
break;
case CWIDGET_CTREE:
clist = gtk_ctree_new (cldef->columns, 0);
gtk_ctree_set_line_style (GTK_CTREE (clist), GTK_CTREE_LINES_NONE);
gtk_ctree_set_expander_style (GTK_CTREE (clist), GTK_CTREE_EXPANDER_TRIANGLE);
gtk_ctree_set_indent (GTK_CTREE (clist), 10);
break;
default:
return NULL;
}
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrollwin), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
GTK_CLIST_SET_FLAG (GTK_CLIST (clist), CLIST_SHOW_TITLES);
gtk_container_add (GTK_CONTAINER (scrollwin), clist);
gtk_clist_set_selection_mode (GTK_CLIST (clist), cldef->mode);
for (i = 0; i < cldef->columns; i++) {
g_snprintf (buf, 256, "/" CONFIG_FILE "/%s Geometry/%s=%d",
cldef->name, cldef->cols[i].name, cldef->cols[i].width);
gtk_clist_set_column_width (GTK_CLIST (clist), i, config_get_int (buf));
if (cldef->cols[i].justify != GTK_JUSTIFY_LEFT) {
gtk_clist_set_column_justification (GTK_CLIST (clist), i, cldef->cols[i].justify);
}
alignment = gtk_alignment_new (0.0, 0.5, 0.0, 0.0);
label = gtk_label_new (_(cldef->cols[i].name));
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_container_add (GTK_CONTAINER (alignment), label);
gtk_widget_show (label);
cldef->cols[i].widget = label;
gtk_clist_set_column_widget (GTK_CLIST (clist), i, alignment);
gtk_widget_show (alignment);
}
gtk_clist_set_sort_column (GTK_CLIST (clist), cldef->sort_column);
gtk_clist_set_sort_type (GTK_CLIST (clist), cldef->sort_type);
clist_column_set_title (GTK_CLIST (clist), cldef, TRUE);
return clist;
}
示例10: move_transfer_down
void
move_transfer_down (gpointer data)
{
GList * firstentry, * secentry, * lastentry;
gftpui_common_curtrans_data * transdata;
GtkCTreeNode * node;
if (GTK_CLIST (dlwdw)->selection == NULL)
{
ftp_log (gftp_logging_error, NULL,
_("There are no file transfers selected\n"));
return;
}
node = GTK_CLIST (dlwdw)->selection->data;
transdata = gtk_ctree_node_get_row_data (GTK_CTREE (dlwdw), node);
if (transdata->curfle == NULL)
return;
g_static_mutex_lock (&transdata->transfer->structmutex);
if (transdata->curfle->next != NULL && (!transdata->transfer->started ||
(transdata->transfer->curfle != transdata->curfle &&
transdata->transfer->curfle != transdata->curfle->next)))
{
if (transdata->curfle->prev == NULL)
{
firstentry = transdata->curfle->next;
lastentry = transdata->curfle->next->next;
transdata->transfer->files = firstentry;
transdata->transfer->files->prev = NULL;
transdata->transfer->files->next = transdata->curfle;
transdata->curfle->prev = transdata->transfer->files;
transdata->curfle->next = lastentry;
if (lastentry != NULL)
lastentry->prev = transdata->curfle;
}
else
{
firstentry = transdata->curfle->prev;
secentry = transdata->curfle->next;
lastentry = transdata->curfle->next->next;
firstentry->next = secentry;
secentry->prev = firstentry;
secentry->next = transdata->curfle;
transdata->curfle->prev = secentry;
transdata->curfle->next = lastentry;
if (lastentry != NULL)
lastentry->prev = transdata->curfle;
}
gtk_ctree_move (GTK_CTREE (dlwdw),
((gftp_file *) transdata->curfle->data)->user_data,
transdata->transfer->user_data,
transdata->curfle->next != NULL ?
((gftp_file *) transdata->curfle->next->data)->user_data: NULL);
}
g_static_mutex_unlock (&transdata->transfer->structmutex);
}
示例11: source_ctree_remove_master_group
//static void source_ctree_remove_master_group (GtkWidget *ctree,
void source_ctree_remove_master_group (GtkWidget *ctree, struct master *m) {
GtkCTreeNode *node;
if (!m->isgroup)
return;
node = gtk_ctree_find_by_row_data (GTK_CTREE (ctree), NULL, m);
if (node) {
gtk_ctree_remove_node (GTK_CTREE (ctree), node);
}
}
示例12: plCTRow
static void plCTRow(GtkWidget * widget, gint row, gint column, GdkEventButton * bevent, gpointer data)
{
DirNodeType * DirNode;
GtkCTreeNode * node;
node=gtk_ctree_node_nth( GTK_CTREE( widget ),row );
DirNode=gtk_ctree_node_get_row_data( GTK_CTREE( widget ),node );
current_path=DirNode->path;
gtk_ctree_expand( GTK_CTREE( widget ),node );
scan_dir( DirNode->path );
if ( CLFileSelected ) free( CLFileSelected ); CLFileSelected=calloc( 1,NrOfEntrys * sizeof( int ) );
}
示例13: putmail
int
putmail (GtkWidget * widget)
{
synopsis *s;
GtkCTreeNode *n;
GtkWidget *from, *subj, *date, *recipt, *body;
char *shtuff;
if (widget != NULL)
{
n = gtk_ctree_node_nth (GTK_CTREE (widget),
(&(GTK_CTREE (widget)->clist))->focus_row);
s = (synopsis *) gtk_ctree_node_get_row_data (GTK_CTREE (widget),
n);
if (s)
shtuff = (char *) db_read_body (s->id);
else
{
printf ("synopsis for row %d is NULL!\n", (&(GTK_CTREE (widget)->clist))->focus_row);
return FALSE;
}
}
else
{
s = (synopsis *) malloc (sizeof (synopsis));
s->sender = strdup (" ");
s->subject = strdup (" ");
s->date = strdup (" ");
s->sender = strdup (" ");
shtuff = strdup (" ");
}
from = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (gems), "entry1");
date = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (gems), "entry2");
subj = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (gems), "entry3");
recipt = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (gems), "entry4");
body = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (gems), "text1");
gtk_entry_set_text (GTK_ENTRY (from), s->sender);
gtk_entry_set_text (GTK_ENTRY (subj), s->subject);
gtk_entry_set_text (GTK_ENTRY (date), s->date);
gtk_text_freeze (GTK_TEXT (body));
gtk_text_set_point (GTK_TEXT (body), 0);
gtk_text_forward_delete (GTK_TEXT (body),
gtk_text_get_length (GTK_TEXT (body)));
gtk_text_insert (GTK_TEXT (body), NULL, NULL, NULL, shtuff, -1);
gtk_text_thaw (GTK_TEXT (body));
if (widget == NULL)
{
free (s);
free (shtuff);
}
return TRUE;
}
示例14: source_ctree_select_source
void source_ctree_select_source (struct master *m) {
GtkCTreeNode *node;
GtkVisibility vis;
node = gtk_ctree_find_by_row_data (GTK_CTREE (source_ctree), NULL, m);
gtk_ctree_unselect_recursive (GTK_CTREE (source_ctree), NULL);
gtk_ctree_select (GTK_CTREE (source_ctree), node);
vis = gtk_ctree_node_is_visible (GTK_CTREE (source_ctree), node);
if (vis != GTK_VISIBILITY_FULL)
gtk_ctree_node_moveto (GTK_CTREE (source_ctree), node, 0, 0.2, 0.0);
}
示例15: on_toolbar_reply_clicked
void
on_toolbar_reply_clicked (GtkButton * UNUSED(button), gpointer UNUSED(user_data))
{
synopsis *s;
GtkCTreeNode *n;
GtkWidget *from, *subj, *date, *recipt, *body, *comp, *widget;
char *shtuff, buf[1024];
if ((widget = lookup_widget (gems, "mailbox")) == NULL)
return;
comp = create_compose ();
from = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (comp), "entry1");
/* to = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (comp), "entry5"); */
date = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (comp), "entry2");
subj = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (comp), "entry6");
recipt = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (comp), "entry4");
body = (GtkWidget *) gtk_object_get_data (GTK_OBJECT (comp), "text2");
n = gtk_ctree_node_nth (GTK_CTREE (widget),
(&(GTK_CTREE (widget)->clist))->focus_row);
s = (synopsis *) gtk_ctree_node_get_row_data (GTK_CTREE (widget), n);
shtuff = replyify (s, (char *)db_read_body (s->id));
gtk_entry_set_text (GTK_ENTRY (from), s->sender);
/*
* if(!strncasecmp("re: ", s->subject, 4))
*/
if (tolower (s->subject[0]) == 'r' && tolower (s->subject[1]) == 'e'
&& s->subject[2] == ':' && s->subject[3] == ' ')
sprintf (buf, "%s", s->subject);
else
sprintf (buf, "Re: %s", s->subject);
gtk_entry_set_text (GTK_ENTRY (subj), buf);
gtk_entry_set_text (GTK_ENTRY (date), s->date);
gtk_text_freeze (GTK_TEXT (body));
gtk_text_set_point (GTK_TEXT (body), 0);
gtk_text_forward_delete (GTK_TEXT (body),
gtk_text_get_length (GTK_TEXT (body)));
gtk_text_insert (GTK_TEXT (body), NULL, NULL, NULL, shtuff, -1);
gtk_text_thaw (GTK_TEXT (body));
if (widget == NULL)
{
free (s);
free (shtuff);
}
gtk_text_set_editable (GTK_TEXT (body), TRUE);
gtk_widget_show (comp);
return;
}