Mercurial > dwindows
comparison dwtest.c @ 333:b6491cefa512
Add test for switch-page signal.
author | mhessling@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Wed, 09 Apr 2003 09:55:10 +0000 |
parents | e00aff2b899e |
children | 97029f1f29de |
comparison
equal
deleted
inserted
replaced
332:7b0f00729a32 | 333:b6491cefa512 |
---|---|
384 sprintf(buf,"DW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x", (unsigned int)window, (unsigned int)item, text, (unsigned int)itemdata ); | 384 sprintf(buf,"DW_SIGNAL_ITEM_SELECT: Window: %x Item: %x Text: %s Itemdata: %x", (unsigned int)window, (unsigned int)item, text, (unsigned int)itemdata ); |
385 dw_window_set_text( statline, buf); | 385 dw_window_set_text( statline, buf); |
386 return 0; | 386 return 0; |
387 } | 387 } |
388 | 388 |
389 int DWSIGNAL switch_page_cb( HWND window, int page_num, void *itemdata ) | |
390 { | |
391 FILE *fp=fopen("log","a"); | |
392 fprintf(fp,"DW_SIGNAL_SWITCH_PAGE: Window: %x PageNum: %d Itemdata: %x\n", (unsigned int)window, (unsigned int)page_num, (unsigned int)itemdata ); | |
393 fclose(fp); | |
394 return 0; | |
395 } | |
396 | |
389 void archive_add(void) | 397 void archive_add(void) |
390 { | 398 { |
391 HWND browsebutton, browsebox; | 399 HWND browsebutton, browsebox; |
392 | 400 |
393 lbbox = dw_box_new(BOXVERT, 10); | 401 lbbox = dw_box_new(BOXVERT, 10); |
622 notebookbox = dw_box_new( BOXVERT, 5 ); | 630 notebookbox = dw_box_new( BOXVERT, 5 ); |
623 dw_box_pack_start( mainwindow, notebookbox, 0, 0, TRUE, TRUE, 0); | 631 dw_box_pack_start( mainwindow, notebookbox, 0, 0, TRUE, TRUE, 0); |
624 | 632 |
625 notebook = dw_notebook_new( 1, TRUE ); | 633 notebook = dw_notebook_new( 1, TRUE ); |
626 dw_box_pack_start( notebookbox, notebook, 100, 100, TRUE, TRUE, 0); | 634 dw_box_pack_start( notebookbox, notebook, 100, 100, TRUE, TRUE, 0); |
635 dw_signal_connect(notebook, DW_SIGNAL_SWITCH_PAGE, DW_SIGNAL_FUNC(switch_page_cb), NULL); | |
627 | 636 |
628 notebookbox1 = dw_box_new( BOXVERT, 5 ); | 637 notebookbox1 = dw_box_new( BOXVERT, 5 ); |
629 notebookpage1 = dw_notebook_page_new( notebook, 0, TRUE ); | 638 notebookpage1 = dw_notebook_page_new( notebook, 0, TRUE ); |
630 dw_notebook_pack( notebook, notebookpage1, notebookbox1 ); | 639 dw_notebook_pack( notebook, notebookpage1, notebookbox1 ); |
631 dw_notebook_page_set_text( notebook, notebookpage1, "buttons and entry"); | 640 dw_notebook_page_set_text( notebook, notebookpage1, "buttons and entry"); |