示例#1
0
文件: callbacks.c 项目: erikg/GEMS
void
on_toolbar_next_clicked (GtkButton * UNUSED(button), gpointer UNUSED(user_data))
{
    GtkCTree *ctree;
    GtkCTreeNode *n;

    ctree = GTK_CTREE (lookup_widget (gems, "mailbox"));
    if (ctree->clist.rows == 0)
	return;
    n = gtk_ctree_node_nth (GTK_CTREE (ctree),
	(&(GTK_CTREE (ctree)->clist))->focus_row);

    gtk_ctree_unselect (GTK_CTREE (ctree), n);
    if ((&(GTK_CTREE (ctree)->clist))->focus_row <
	((&(GTK_CTREE (ctree)->clist))->rows - 1))
	(&(GTK_CTREE (ctree)->clist))->focus_row++;
    n = gtk_ctree_node_nth (GTK_CTREE (ctree),
	(&(GTK_CTREE (ctree)->clist))->focus_row);
    gtk_ctree_select (GTK_CTREE (ctree), n);

    if (gtk_ctree_node_is_visible (GTK_CTREE (ctree),
	    n) != GTK_VISIBILITY_FULL)
	gtk_ctree_node_moveto (GTK_CTREE (ctree), n, 0, 1, 0);

    putmail (GTK_WIDGET (ctree));
    return;
}
示例#2
0
文件: ctree.c 项目: amery/clip-itk
/* Unselect the given node and emit the appropriate signal. */
int
clip_GTK_CTREEUNSELECT(ClipMachine * cm)
{
	C_widget   *cctree = _fetch_cw_arg(cm);
	C_object    *cnode = _fetch_cobject(cm,_clip_spar(cm,2));
	CHECKCWID(cctree,GTK_IS_CTREE);
	CHECKOPT2(2,MAP_t,NUMERIC_t); CHECKCOBJOPT(cnode,cnode->type==GTK_TYPE_CTREE_NODE);
	gtk_ctree_unselect(GTK_CTREE(cctree->widget),
			GTK_CTREE_NODE(cnode->object));
	return 0;
err:
	return 1;
}