PIPS
|
#include <sys/param.h>
#include <sys/stat.h>
#include "genC.h"
#include "misc.h"
#include "database.h"
#include "linear.h"
#include "ri.h"
#include "ri-util.h"
#include "pipsdbm.h"
#include <gtk/gtk.h>
#include "gpips.h"
Go to the source code of this file.
Macros | |
#define | MAXNAMELEN MAXNAMLEN |
lint More... | |
Enumerations | |
enum | { MENU_PATH_DATA_HANDLER = 54829 , GPIPS_MAX_DIRECTORY_MENU_SIZE = 80 } |
Functions | |
static GtkWidget * | directory_gen_pullright (GtkWidget *widget) |
static void | generate_a_directory_menu_notify (GtkWidget *widget, gpointer data) |
GtkWidget * | generate_a_directory_menu (char *directory) |
Variables | |
char | vcid_directory_menu [] = "$Id: directory_menu.c 23065 2016-03-02 09:05:50Z coelho $" |
Generate a menu from the current directory to serve as a directory chooser. More... | |
#define MAXNAMELEN MAXNAMLEN |
lint
To have SunOS 5.5 happy about MAXNAMELEN (in SunOS 4, it is already defined in sys/dirent.h): To have SunOS4 still working:
Definition at line 45 of file directory_menu.c.
anonymous enum |
Enumerator | |
---|---|
MENU_PATH_DATA_HANDLER | |
GPIPS_MAX_DIRECTORY_MENU_SIZE | Maximum size of the directory menu of the main frame: |
Definition at line 61 of file directory_menu.c.
|
static |
First get the parent directory name that is the title:
Build the new directory name:
Well, there is already a menu... we've been already here. Free it first:
Free the associated directory name:
Then initialize it with a new directory menu:
Definition at line 74 of file directory_menu.c.
References debug(), generate_a_directory_menu(), gpips_gtk_menu_item_get_label(), and MAXNAMELEN.
Referenced by generate_a_directory_menu().
GtkWidget* generate_a_directory_menu | ( | char * | directory | ) |
Get all the files in the directory:
Generate a corresponding entry for each file:
Skip the "." directory:
Since a menu item cannot be selected as an item, add an plain item with the same name. Not beautiful hack... :-(
And disable non-subdirectory entry:
Definition at line 124 of file directory_menu.c.
References buf, db_get_current_workspace_name(), directory_exists_p(), directory_gen_pullright(), file_name, gen_array_full_free(), gen_array_item(), gen_array_make(), gen_array_nitems(), generate_a_directory_menu_notify(), GPIPS_MAX_DIRECTORY_MENU_SIZE, MAXNAMELEN, pips_debug, pips_user_warning, safe_list_files_in_directory(), and user_warning.
Referenced by directory_gen_pullright(), and generate_directory_menu().
|
static |
Definition at line 107 of file directory_menu.c.
References end_directory_notify(), gpips_gtk_menu_item_get_label(), and MAXNAMELEN.
Referenced by generate_a_directory_menu().
char vcid_directory_menu[] = "$Id: directory_menu.c 23065 2016-03-02 09:05:50Z coelho $" |
Generate a menu from the current directory to serve as a directory chooser.
Definition at line 31 of file directory_menu.c.