algorithms.us - Blake McBride - Arahant.com
     
fader
 
Nav Header
  - Company
  - Software Projects
  - Philosophy Interest
  - GO Links
  - Contact
  - Home Page
table-botm
 
Software Projects
: Dynace
: WDS : Sample Code

WDS Sample - Add a Menu

The actual menu is defined using the resource editor which comes with your compiler. This example loads the defined menu and associates two functions to it such that when the user selects the menu option the specified function will be evoked.

#include "generics.h"
#include "resource.h"

static long file_message(object wind);
static long file_exit(object wind);

int start()
{
object win;

win = vNew(MainWindow, "My Test Application");

vPrintf(win, "Hello, World!\n");

mLoadMenu(win, IDR_MENU1);
mAssociate(win, ID_FILE_MESSAGE, file_message);
mAssociate(win, ID_FILE_EXIT, file_exit);

return gProcessMessages(win);
}

static long file_message(object wind)
{
gMessage(wind, "File_Message");
return 0L;
}

static long file_exit(object wind)
{
gQuitApplication(Application, 0);
return 0L;
}

[ Back to Top ]
 


Company | Software Projects | Philosophy Interest
GO Links | Contact | Home Page


Site Content 2006 Blake McBride.
All Rights Reserved.


.

.