You may return to the Cvo Object Documenation Index from this document. This document contains the following sections describing the Cvo__OpenFile object:
Cvo__OpenFile
Cvo_Window
#include
<Cvo/OpenFile.h++>
void
Cvo_OpenFile ( Cvo_Object *parent,
XEvent *event,
Cvo_OpenFileInfo *info )
This object provides a method to allow a user to browse the file system and select a filename. It will create a window with several selection areas for a filename, a filename filter, a list of directories, and a list of files in the current directory which match the given filename filter. The window has two buttons, one for selecting the currently highlighted filename, and one for dismissing the window. The window has a Cvo_Pin, and when pressed in, the window will not close when a filename is selected.
The object should always be created by the Cvo_OpenFile()
function. This function takes arguments in the event handler style,
since Cvo__OpenFile objects will generally be created from menus. To
create a Cvo__OpenFile object from a menu, simply use
Cvo_OpenFile()
as the func argument to Cvo_MenuItem and
Cvo_MenuEntry objects.
The parent argument will be used when positioning the
Cvo__OpenFile window, and when selecting the object which will
receive the CvoOpenFileEvent
from the Cvo__OpenFile object. The event
will be passed to the root of the object tree containing parent.
In other words, if parent is a Cvo_Button object, which is a
child of a Cvo_Frame object, which is a child of a Cvo_Application
object, then the CvoOpenFileEvent
will be sent to the
Cvo_Application object.
The info argument should be a pointer to a Cvo_OpenFileInfo object. Note that when creating a Cvo__OpenFile object from a menu, the data argument to Cvo_MenuItem or Cvo_MenuEntry should be info, a pointer to a Cvo_OpenFileInfo object.
The X resource name of the info object will be used to locate
resources for this Cvo__OpenFile object. For instance, if the
info object was created with a resource name of openfile
,
then the resource *openfile.Title
will be used to set the title
for this Cvo__OpenFile object.
In addition, the Cvo_OpenFileInfo object has several member functions which can be used to modify the behavior of the Cvo__OpenFile object it is associated with.
This object defines the following Cvo Events in addition to those defined by its parent and ancestor objects.
CvoOpenFileEvent
struct
Cvo_OpenFileEvent
char *filename,
void *data
This Cvo event is sent when a filename selection is made, or when the
Cvo__OpenFile object is closed. If a selection has been made, then
the filename element will point to the selected filename.
Otherwise, it will be a NULL
value. The data element is the
value set by the SetData()
function of Cvo_OpenFileInfo.
This object is composed of the following Cvo objects. Each object has the shown resource name. This link displays the composition of the parent object.
Cvo_Frame
:
*CvoOpenFile.title_frame
Cvo_Pin
:
*CvoOpenFile.title_frame.pin
Cvo_Label
:
*CvoOpenFile.title_frame.filter_label
Cvo_Label
:
*CvoOpenFile.dirfile_label
Cvo_Input
:
*CvoOpenFile.file
Cvo_Label
:
*CvoOpenFile.filter_label
Cvo_Input
:
*CvoOpenFile.filter
Cvo_Frame
:
*CvoOpenFile.lists
Cvo_Frame
:
*CvoOpenFile.lists.dirframe
Cvo_Label
:
*CvoOpenFile.lists.dirframe.dir_label
Cvo_List
:
*CvoOpenFile.lists.dirframe.directories
Cvo_Frame
:
*CvoOpenFile.lists.fileframe
Cvo_Label
:
*CvoOpenFile.lists.fileframe.file_label
Cvo_List
:
*CvoOpenFile.lists.fileframe.files
Cvo_Frame
:
*CvoOpenFile.buttons
Cvo_Button
:
*CvoOpenFile.buttons.open
Cvo_Button
:
*CvoOpenFile.buttons.dismiss
This object uses the following X resources in addition to those used by its parent and ancestor objects.
*CvoOpenFile.title
(class:
Title
) (default value:
Open
)
This resource is used to set the title of the Cvo__OpenFile object's
window. The value of the resource will be passed to the
ExpandName()
member function of the Cvo_Object object for
expansion of macros. See that function for available macros.
See the example source code for an example of how to use this object.
See the legend for information about the conventions used in this documentation.