Commits

daonix  committed cb118fc

"Hello, World!" improved.

  • Participants
  • Parent commits a0ae511

Comments (0)

Files changed (1)

         ~window_type:Beapi.B_UNTYPED_WINDOW ~flags:0 ~workspaces:0 ()
     val quit_requested = fun () -> 1
     val message_received = fun message -> message
+	method bounds = BWindow.bounds ~self:object_pointer ()
     method show = BWindow.show ~self:object_pointer ()
+	initializer
+	  let view = BView.bview self#bounds
+	    BView.null Beapi.b_FOLLOW_ALL_SIDES Beapi.b_WILL_DRAW in
+	  self#add_child ~aView:view ~sibling:(BView.null ()) ;
+	  let button = BButton.bbutton (BView.bounds ~self:view ())
+	    "Hello" "Hello" (BMessage.bmessage 1 ()) in
+	  BView.add_child ~aView:(Beapi.bview_of_bbutton button)
+	    ~sibling:(BView.null ())
   end
 
 class hello_haiku =
             ~right:300.0 ~bottom:200.0 ()) in
       win#show
     method run = BApplication.run ~self:object_pointer ()
-    initializer BApplication.setReadyToRun ~self:object_pointer ~cb:ready_to_run ()
+    initializer
+	  BApplication.setReadyToRun ~self:object_pointer ~cb:ready_to_run ()
   end
 
 let _ = let app = new hello_haiku in app#run