Data slots in parents not cloning?
    Jeremy Cowgar 
    jeremy at cowgar.com
       
    Tue Aug 25 16:40:42 UTC 2009
    
    
  
Here are just the important snippets of code. The problem is that all my
buttons contain the same "handle"...
//===========================================
// control.li
Section Header
  + name := CONTROL;
Section Private
  + handle:POINTER;
  - set_handle h:POINTER <- 
  (
    handle := h;
  );
//===========================================
// button.li
Section Header
  + name := BUTTON;
Section Inherit
  + parent:CONTROL := CONTROL;
Section Public
  - make title:ABSTRACT_STRING <-
  ( + result:BUTTON;
    + h:POINTER;
    + n_title:NATIVE_ARRAY(CHARACTER);
    n_title := title.to_external;
    h := `IupButton(@n_title)`:POINTER;
    result := BUTTON.clone;
    result.set_handle h;
    result
  );
//===========================================
// example.li
Section Header
  + name := EXAMPLE;
Section Public
  - main <- 
  ( + b1, b2:BUTTON;
    b1 := BUTTON.make "Hello";
    b1.handle.println;
    b2 := BUTTON.make "Goodbye";
    b2.handle.println;
    "Buttons after all have been created:".println;
    b1.handle.println;
    b2.handle.println;
  );
  
//===========================================
The output is something like:
13990D8
14209A3
Buttons after all have been created:
14209A3
14209A3
Any thoughts on this?
-- 
Jeremy Cowgar <jeremy at cowgar.com>
    
    
More information about the Lisaac-devel
mailing list