Paste: Not a listbox

Author: Muzzleflash
Mode: factor
Date: Fri, 29 May 2009 16:22:25
Plain Text |
! Copyright (C) 2009 Søren Enevoldsen.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel io ui ui.gadgets.panes ui.gadgets ui.gadgets.scrollers ui.gadgets.editors ui.gadgets.packs ui.gadgets.labeled ;
IN: pane-receiver

! Create pane
: create-pane ( -- pane ) <pane> ;
! Create input field that updates pane
: create-input-field ( pane -- action-field ) [ swap [ print ] curry with-pane ] curry <action-field> ;

: create-ui ( -- ) 
  [
   create-pane
   dup create-input-field
      ! Make names for gadgets.
      [ "Pane" <labeled-gadget> ]
      [ "Text Input" <labeled-gadget> ]
      bi*
   <pile>
   ! Add bot to pile
   [ [ swap add-gadget ] curry bi@ ] keep
   
    "Testing" open-window
  ] with-ui ;

Annotation: missing USING directive

Author: yebyen
Mode: factor
Date: Mon, 1 Jun 2009 04:38:52
Plain Text |
USING: ui.gadgets.pane
! latest factor as of today complains if you don't.
! not the only problem, unless I had a typo... something about wrong stack effect
! it seems to work though!

New Annotation

Summary:
Author:
Mode:
Body: