[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

ncurses og forms i window (was: Re: [CPROG] ncurses og defaultforground/background)



On Mon, 13 Jan 2003 21:57:21 +0100
"Klaus S. Madsen" <sslug@sslug> wrote:
> On Mon, Jan 13, 2003 at 06:59:20PM +0100, Kim Schulz wrote:
> > hejsa
> > 
> > så er jeg kommet igang med mit CUI i ncurses, men jeg har ikke
> > rigtigt kunne finde noget om hvordan man sætter en generel forgrund
> > og baggrundsfarve for hele programmet
> Du kan sætte baggrunden for stdscr med funktionen bkgdset (og wbkgdset
> for vinduer). Derefter mener jeg at du er nødt til at kalde erase
> (eller werase) for at få curses til at gentegne hele skærmen.

det var nu wbkgd() som skulle bruges (den anden satte kun baggrund for
tegn der allerede var skrevet). 

Nå men så kan du måske også give mig et hurtigt eksempel på hvordan jeg
laver et hurtigt vindue som indeholder en FIELD der, når der trykkes
enter, putter indhold af field ind i den globale variabel pos?

jeg har prøvet på at lave noget af det, men den coredumper desværre.
her er mit (ikke ret gode) forsøg:

int show_input_pos_win(WINDOW *input_pos_win){

        FIELD *input_pos_field[1];
        FORM *pos_form;
        input_pos_field[0]= new_field(1,3,LINES/2,COLS/2-5,0,0);
        pos_form = new_form(input_pos_field);
//      post_form(pos_form);
        refresh();
        mvprintw(4, 10, "Value 1:");
        mvprintw(6, 10, "Value 2:");
        refresh();
        set_field_back(input_pos_field[0], A_UNDERLINE);
        field_opts_off(input_pos_field[0], O_AUTOSKIP);

        set_form_win(pos_form,input_pos_win);
        set_form_sub(pos_form, derwin(input_pos_win, 10, 10, 10, 10));
        /* Print a border around the main window and print a title */
        box(input_pos_win, 0, 0);
        post_form(pos_form);
 



        return pos;
}

ja jeg ved godt at den endnu ikke propper værdien over i pos, men gdb
siger at den allerede crasher før den når så langt. 

MVH
Kim


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:09 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *