Changeset 25575 in project


Ignore:
Timestamp:
11/26/11 10:46:54 (9 years ago)
Author:
juergen
Message:

iup-tutor updated

Location:
wiki
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/iup

    r23711 r25575  
    1717See [[http://www.chust.org/fossils/iup/doc/trunk/api/main.wiki|the official API docs]].
    1818
     19=== Examples
     20
     21See [[iup-tutor|Tutorial on the Iup GUI toolkit]]
     22
    1923=== License
    2024
  • wiki/iup-tutor

    r25572 r25575  
    1717Hence you need to consult the original C documentation very often. So it
    1818seems appropriate to start with an example (Hello World, you guess it)
    19 showing how a C program is transformed to Scheme. But before that let me
    20 recapitulate some design principles of Iup.
     19showing how a C program is translated to Scheme. This way you'll become
     20comfortable writing Scheme programs while using the original C
     21documentation. But before that let me recapitulate some design
     22principles of Iup.
    2123
    2224=== Iup's design principles
     
    3537First: No widget is ever positioned with explicit coordinates.
    3638Everything is done logically by nesting containers and positioning
    37 widgets. This facilitates matters considerably.
     39widgets like fill. This facilitates matters considerably.
    3840
    3941Second: All widgets and dialogs are controlled by attributes, including
     
    226228<enscript highlight="C">
    227229
    228 widget=widget-name[attribute-name=attribute-value, ...](arg, ...)
     230widget=widget-type[attribute-name=attribute-value, ...](arg, ...)
    229231
    230232</enscript>
     
    239241btn = button[TIP = "Close window", EXPAND = Yes]
    240242            ("&Ok", 0)
     243
    241244dlg = dialog[TITLE = Hello]
    242245            (vbox[GAP = 10, MARGIN = 15x15, ALIGNMENT = ACENTER]
     
    263266</enscript>
    264267
    265 Note, that the LED-import is done vial load/let and the identification
     268Note, that the LED-import is done via load/let and the identification
    266269of LED-names with Chicken-variables via handle-ref.
    267270
    268 Note also, that btn must be coded separately, because we need to set the
    269 callback, which can not be a string.
     271Note also, that btn must be coded separately and given a name, because
     272we need to set the callback, which can not be a string.
    270273
    271274You can compile hello13.scm with csc and change hello.led afterwards.
    272 Try it out and play with some attributes ...
     275Try it out and play with some attributes, for example, remove the
     276EXPAND attribute from btn and set it for label, ...
    273277
    274278=== Porting some examples from the Iup Distribution
     
    278282
    279283==== fill.scm
     284
     285The following dialog shows, how different positions of the fill widget
     286change the dialog's appearance.
    280287
    281288<enscript highlight="Scheme">
     
    319326                        'close)))
    320327    title: "Right aligned"))
     328
    321329; Note, that callbacks should return a symbol.
    322330; Only the symbol 'close of the action: callbacks closes the dialog!
     
    340348
    341349==== hbox.scm
     350
     351This dialog shows, how horizontal boxes within vertical ones work.
    342352
    343353<enscript highlight="Scheme">
     
    388398</enscript>
    389399
    390 Now a menu example
    391 
    392400==== menu.scm
    393401
    394 Now a dialog with a menu.
     402Now a dialog with a menu and submenus, one of whose items call a
     403predefined message-dialog.
    395404
    396405<enscript highlight="Scheme">
     
    454463Nov 25, 2011
    455464
     465== Last updated
     466
     467Nov 26, 2011
Note: See TracChangeset for help on using the changeset viewer.