File: up_button_callback.C

package info (click to toggle)
peruser 4b33-10
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,944 kB
  • ctags: 1,064
  • sloc: cpp: 22,397; perl: 2,733; makefile: 345; sh: 335
file content (48 lines) | stat: -rw-r--r-- 1,047 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <stdlib.h>
#include <stdio.h>

#include <gtk/gtk.h>

#include "npfile.h"
#include "npstringarray.h"
#include "npgroup.h"
#include "npnode.h"
#include "nptree.h"
#include "npcollections.h"

void up_button_callback( GtkWidget *widget, gpointer data )
{
   NP_Collections *collections = ( NP_Collections *)data;

   if ( !collections->total_groups )
      return;

   if ( collections->selected_item == NULL )
      return;

   NP_Collections::np_master_group_list_t *group = 
      collections->master_group_list;

   for( int i = 0; i < collections->total_groups; ++i )
   {
      if ( collections->selected_item == group[ i ].node )
      {
         while( ++i < collections->total_groups )
            if ( group[ i ].unseen )
            {
               collections->button = 1;
               gtk_tree_select_child( GTK_TREE( collections->tree_widget ),
                                      group[ i ].node );
               collections->button = 0;
               break;
            }

         break;
      }
   }

   return;
}