Category : C Source Code
Archive   : WTWG12B.ZIP
Filename : WBUTTOND.C

 
Output of file : WBUTTOND.C contained in archive : WTWG12B.ZIP
/* WBUTTOND.C
*
* contains wbutton_delete () -- remove a button from the list.
*
*/
#include "wsys.h"






void wbutton_delete (int uval, int redraw)
{
WBUTTON *Bptr, **chain;



chain = & (w0->winbutton ); /* address of chain */

for ( Bptr = w0->winbutton;
Bptr;
chain = &(Bptr->Bchain), Bptr = Bptr->Bchain )
{
if ( Bptr->Bval == uval )
{

if ( 0== redraw )
{
/* need to erase button
* so setup a 'blank' button.
* in the large model, *(NULL) is not necessarily 0
*/
Bptr-> Btext = " ";
}

if ( Bptr-> Bstyle & WBTN_BOX )
{
/* erase the box first,
* then shrink the size counters
* so that wbutton_draw will work
* in text area only.
*/
wbutton_frame ( Bptr, NO_BORDER, wgetattr() );

++(Bptr->Bx);
++(Bptr->By);
--(Bptr->Bxend);
--(Bptr->Byend);
}

wbutton_draw ( Bptr, wgetattr() );

/* unlink button from chain */
*chain = Bptr->Bchain;

free ( Bptr );


break; /* found button -- quit */

}


}


return; /* wbutton_delete () */
}



  3 Responses to “Category : C Source Code
Archive   : WTWG12B.ZIP
Filename : WBUTTOND.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/