delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/05/14/22:15:24

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: degoble AT gtech (David. E. Goble)
Newsgroups: comp.os.linux.development.apps,comp.os.msdos.djgpp
Subject: trying to learn pdcurses, need help
Date: Wed, 15 May 2002 02:11:02 GMT
Message-ID: <3ce1ba8c.4340496@news.adelaide.on.net>
X-Newsreader: Forte Free Agent 1.21/32.243
NNTP-Posting-Host: dialup-143.96.220.203.acc01-waym-adl.comindico.com.au
X-Trace: duster.adelaide.on.net 1021428663 dialup-143.96.220.203.acc01-waym-adl.comindico.com.au (15 May 2002 11:41:03 +0950)
Lines: 217
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi All;

Anyone know where I can get some docs/howto for pdcurses?

Iam trying to learn pdcurses. Iam trying to change the tuidemo.c by
P.J. Kunst  (kunst AT prl DOT philips DOT nl).

I managed to change the menus and currently Iam trying to get an about
box working. It works but, the box has no borders and the colors are
black and white.

Also I would like the text to be centered...

any help will be welcomed, thanks

/* gcc myc.c tui.c -o myc.exe -If:\pdcurses f:\pdcurses\pdcurses.a */

#ifdef HAVE_CONFIG_H
#  include <config.h>
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "tui.h"

#if defined(XCURSES)
    char *XCursesProgramName = "myc";
# define FNAME   "/tui.c"    /* change this if source at other
location */
#else
# define FNAME   "\\tui.c"    /* change this if source at other
location */
#endif

void doAbout(void)
{
WINDOW *winAbout;
const char *name="myc";
const char *author="David. E. Goble";

  winAbout=newwin(5, 40, 5, 15); /* window relative */
    
  wprintw(winAbout, "Kangaroo Island Pistol Club - Database\n\n");
  wprintw(winAbout, "+Prgram: %s (c) by %s\n\n", name, author);
  wprintw(winAbout, "15th of May, 2002\n");
  wrefresh(winAbout);
}

menu AtMenu[]=
{
    {"About",   doAbout,    "About this program..."},
    { "",       (FUNC)0,    ""}   /* always add this as the last item
! */
};

void At(void)
{
    domenu(AtMenu);
}

void doNScores(void)
{
}

void doNMembers(void)
{
}

void doMinutes(void)
{
}

menu NewMenu[]=
{
    {"Scores",  doNScores,  "Add new scores..."},
    {"Members", doNMembers, "Add new members..."},
    {"Minutes", doMinutes,  "Produce the minutes..."},
    {"",        (FUNC)0,    ""}   /* always add this as the last item
! */
};

void New(void)
{
    domenu(NewMenu);
}

void doOScores(void)
{
}

void doOMembers(void)
{
}

menu OpenMenu[]=
{
    {"Scores",  doOScores,  "Browse/Print Scores/Handicaps..."},
    {"Members", doOMembers, "Browse/Print Members/Attendences..."},
    {"",        (FUNC)0,    ""}   /* always add this as the last item
! */
};

void Open(void)
{
    domenu(OpenMenu);
}

void doSave(void)
{
}

void doBackup(void)
{
}

void doRestore(void)
{
}

menu FileMenu[]=
{
    {"New",     New,      "Handle new records..."},
    {"Open",    Open,     "Handle opening records..."},
  /*  {"-",       NULL,       ""}, */
    {"Save",    doSave,     "Handle saving records..."},
/*    {"-",       NULL,       ""},     */
    {"Backup",  doBackup,   "Handle backing up records..."},
    {"Restore", doRestore,  "Handle restoring records..."},
 /*   {"-",       NULL,       ""},  */
    {"Exit",    DoExit,     "Terminate program" },
    {"",        (FUNC)0,    ""}   /* always add this as the last item
! */
};

void File(void)
{
    domenu(FileMenu);
}

void doUndo(void)
{
}

void doCut(void)
{
}

void doCopy(void)
{
}

void doPaste(void)
{
}

void doClear(void)
{
}

void doDate(void)
{
}

menu EditMenu[]=
{
    {"Undo",    doUndo,     "Undo last action" },
/*    {"-",       NULL,       "" },   */
    {"Cut",     doCut,      "Cut selected text..."},
    {"Copy",    doCopy,     "Copy selected test..."},
 /*   {"-",       NULL,       ""},  */
    {"Paste",   doPaste,    "Paste copied text..."},
    {"Clear",   doClear,    "Delete selected text..."},
 /*    ("-",       NULL,       ""},      */
    {"Date",    doDate,     "Paste todays date"},
    {"",        (FUNC)0,    ""}   /* always add this as the last item
! */
};

void Edit(void)
{
    domenu(EditMenu);
}

void doHelp(void)
{
}

menu HelpMenu[]=
{
    {"Browse",  doHelp,     "Browse help file"},
    {"",        (FUNC)0,    ""}   /* always add this as the last item
! */
};

void Help(void)
{
    domenu(HelpMenu);
}

menu MainMenu[]=
{
    {"@",       At,       "Misc; menu..."},
    {"File",    File,     "Handle file operations"},
    {"Edit",    Edit,     "Handle editing operations"},
    {"Help",    Help,     "Provide help on the program"},
    {"",       (FUNC)0,    ""}   /* always add this as the last item !
*/
};

int main (int argc, char **argv)
{
    startmenu (MainMenu, "Kangaroo Island Pistol Club - Database");

return 0;
}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019