Changeset 29331 in project


Ignore:
Timestamp:
07/08/13 17:24:24 (7 years ago)
Author:
mikele
Message:

imported bitbucket text

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/win32-msgbox

    r29330 r29331  
     1[[tags: egg]]
     2[[toc:]]
     3
     4== win32-msgbox
     5
     6win32-msgbox is a Scheme interface to the Windows API [[http://msdn.microsoft.com/en-us/library/windows/desktop/ms645505(v=vs.85).aspx|MessageBox]] function.
     7
     8<enscript highlight=sh>
     9[procedure] (msgbox HOST #!key (title "")
     10                               (buttons 'ok)
     11                               (default-button 1)
     12                               (icon 'none)
     13                               (foreground #t)
     14                               (topmost #f))
     15
     16</enscript>
     17
     18Valid symbols for the ''buttons'' option are:
     19
     20* ok
     21* ok/cancel
     22* abort/retry/ignore
     23* yes/no/cancel
     24* yes/no
     25* retry/cancel
     26* cancel/try/continue
     27
     28Valid symbols for the ''icon'' option are:
     29
     30* none
     31* stop
     32* question
     33* exclamation
     34* information
     35
     36''msgbox'' returns the symbol associated to each button (e.g. the ''retry'' button returns the '''retry'' symbol).
     37
     38=== Requirements
     39
     40A Windows platform of course.
     41
     42=== Usage
     43
     44<enscript highlight=scheme>
     45(use win32-msgbox)
     46</enscript>
     47
     48The *-Wl,--subsystem,windows* linker switch ensures that the application is built as a Windows GUI application, and not as a console application.
     49
     50<enscript highlight=sh>
     51csc -Wl,--subsystem,windows test.scm
     52</enscript>
     53
     54==== Example 1:
     55
     56<enscript highlight=scheme>
     57(use win32-msgbox)
     58
     59(msgbox "Your public IP address is:\n\n7.19.211.65"
     60        title: "Info"
     61        buttons: 'ok
     62        icon: 'information)
     63</enscript>
     64
    165[[image:https://bitbucket.org/miklam/win32-msgbox/wiki/msgbox1.png|example1]]
     66
     67==== Example 2:
     68
     69<enscript highlight=scheme>
     70(use win32-msgbox)
     71
     72(define user-input (msgbox "Resource not available\nDo you want to try again?"
     73                            title: "Warning"
     74                            buttons: 'retry/cancel
     75                            icon: 'exclamation))
     76
     77(or (eq? user-input 'retry)
     78    (exit 1))
     79...
     80</enscript>
     81
     82[[image:https://bitbucket.org/miklam/win32-msgbox/wiki/msgbox2.png|example1]]
     83
     84=== About this software
     85
     86The source code is hosted at [[https://bitbucket.org/miklam/win32-msgbox/|Bitbucket]]. Feel free to send pull requests or open an issue there. Alternatively, send an e-mail to the [[mailto://chicken-users@nongnu.org|chicken-users]] mailing list for information or requests.
     87
     88==== Author
     89
     90[Michele La Monaca](mailto:mikele~lamonaca.net)
     91
     92==== Version history
     93
     94; 1.0 : Initial release
     95
     96==== License
     97
     98Copyright (c) 2013
     99 Michele La Monaca (mikele~lamonaca.net)
     100 All rights reserved.
     101 
     102 Redistribution and use in source and binary forms, with or without
     103 modification, are permitted provided that the following conditions are
     104 met:
     105 
     106 1) Redistributions of source code must retain the above copyright
     107 notice, this list of conditions and the following disclaimer.
     108 
     109 2) Redistributions in binary form must reproduce the above copyright
     110 notice, this list of conditions and the following disclaimer in the
     111 documentation and/or other materials provided with the distribution.
     112 
     113 3) Neither the name of the author nor the names of its contributors
     114 may be used to endorse or promote products derived from this software
     115 without specific prior written permission.
     116 
     117 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     118 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     119 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
     120 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
     121 COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
     122 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     123 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     124 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     125 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     126 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     127 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
     128 OF THE POSSIBILITY OF SUCH DAMAGE.
Note: See TracChangeset for help on using the changeset viewer.