bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: My program or my veins


From: Docume
Subject: Re: My program or my veins
Date: Wed, 21 Aug 2002 22:00:23 +0200 (CEST)

Thanks for your fast answer Thomas.

I think I understand correctly... the new portada() is:

int portada (WINDOW *local_win, int maxy, int maxx) //Should put titulo, autor 
and anio centered
{
    char titulo[]="Ncurses Bug v0.1";
    char autor[]="(c) by Anonymous";
    char anio[]="2002";

    int ancho;

    if (strlen(titulo)>strlen(autor))
        if (strlen(titulo)>strlen(anio))
            {   ancho = strlen(titulo);
                mvwprintw(local_win,maxy/2,(maxx-ancho)/2,"%s",titulo);
            }
    else
        if (strlen(autor)>strlen(anio))
            {   ancho = strlen(autor);
                mvwprintw(local_win,maxy/2,(maxx-ancho)/2,"%s",autor);
            }
        else { ancho = strlen (anio); 
               mvwprintw(local_win,maxy/2,(maxx-ancho)/2,"%s",anio);}

    return 0;
}


Now the window seems to be the same for the text and for the box but... it 
doesn't run correctly maybe I am making do wrefresh(), I think there is 
the problem but I am not sure.

Any idea? Thanks again in advanced. 


On Wed, 21 Aug 2002, Thomas Dickey wrote:

> On Wed, Aug 21, 2002 at 02:14:09PM +0200, Docume wrote:
> > I need to find the answer, it is imperative or I will cut my veins. :-P
> > I can't run my program I spent hours reading papers, newsgroups... and I 
> > couldn't find the solution!!
> > 
> > As Thomas wrote I remove getch() but the program do the same, shows the 
> > box but not the message. AAAAAAAAAAAAAAHHHHHHHHHHHHH 
> > 
> > Kill kill kill ncurses KIIIIIILLLL!!!!!
> 
> ( not necessary ;-)
> 
> I started to look at this last night, but put it aside to work on diffstat
> (was working on lynx).
> 
> The reason why the text doesn't show up is because it is being written to
> stdscr, which is hidden by the window containing the box.  I considered
> making portada() write to that window, but was not sure that was your
> intention.  If portada writes/reads from the same window, there should be
> no problems...
> 
> > int portada (int maxy, int maxx) //Should put titulo, autor and anio 
> > centered
> > {
> >     char titulo[]="Ncurses Bug v0.1";
> >     char autor[]="(c) by Anonymous";
> >     char anio[]="2002";
> >     
> >     int ancho;
> >     
> >     if (strlen(titulo)>strlen(autor))
> >     if (strlen(titulo)>strlen(anio))
> >         {   ancho = strlen(titulo);
> >             mvprintw(maxy/2,(maxx-ancho)/2,"%s",titulo);
> >         }
> >     else 
> >     if (strlen(autor)>strlen(anio))
> >         {   ancho = strlen(autor);
> >             mvprintw(maxy/2,(maxx-ancho)/2,"%s",autor);
> >         }
> >     else { ancho = strlen (anio); 
> > mvprintw(maxy/2,(maxx-ancho)/2,"%s",anio);}
> > 
> >     //getch();
> >     return 0;
> > }
> 
> 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]