Forum Replies Created
- 
		AuthorPosts
 - 
		
			
				
Thanks for your help.
I think Monkey2 is for beginners, so it needs an easy start for beginners.
I have in the meantime looked at the calculator example, but your example is a lot easier.
I have a little bit played with it.A xml description file could look like
XHTML1234567<Control type="Window" name="MyWindow" width="640" heigh="480"><Property name="WindowFlags" value="Resizable" /><Control type="DockingView" name="dockingView"><Control type="Label" name="label" text="Idle"/><Control type="Button" name="button" text="Click ME!"/></Control></Control>That could be used as intermediate langaue for an GUI-designer. Or as additional language like Microsoft doing it with XAML for its WindowsPresentationFoundation.
This XML-code is only a how it could look like, but currently ignored the
dockingView=New DockingView
dockingView.AddView( label,”top” )
dockingView.ContentView=buttonThat xml-file should then generate automatically (or compiled to) the file ButtonDemo_ui.monkey2
Monkey123456789101112131415161718192021222324252627282930313233343536#import "<std>"#import "<mojo>"#import "<mojox>"Using std..Using mojo..Using mojox..Class MyWindow_ui Extends WindowField label:LabelField button:ButtonField dockingView:DockingViewMethod New()Super.New( "Button Demo",640,480,WindowFlags.Resizable )label=New Label( "Idle" )button=New Button( "Click ME!" )button.Clicked=Lambda()button_Clicked()EnddockingView=New DockingViewdockingView.AddView( label,"top" )dockingView.ContentView=buttonContentView=dockingViewEndMethod button_Clicked() VirtualEndEndAnd the written code would then be in the file ButtonDemo.monkey2
Monkey123456789101112131415161718#import "ButtonDemo_ui"Class MyWindow Extends MyWindow_uiField n:=0Method button_Clicked() Overriden+=1label.Text="Clicked #"+n+" window size:"+Width+","+HeightEndEndFunction Main()New AppInstanceNew MyWindowApp.Run()EndGreetings
theuserbl - 
		AuthorPosts