monkey2
monkey2 copied to clipboard
Import MojoX before Mojo is different from vice-versa
In the code below, try swapping the lines that import mojox and mojo. The little separator that allows you to drag the scroll view side to side will not show up.
Not sure if a bug or just a side effect from how the import system works, but it definitely took me a while to catch...
#Import "<mojo>"
#Import "<mojox>" '<------- Try Importing mojox BEFORE mojo, and the ScrollView won't resize like it should
Using std..
Using mojo..
Using mojox..
Function Main()
New AppInstance
New TestWindow
App.Run()
End
Class TestWindow Extends Window
Public
Method New()
Super.New( "Test", 800, 600, WindowFlags.Resizable )
Local dock := New GameDock
ContentView = dock
End
End
Class GameDock Extends DockingView
Method New()
Local toolbar := New ToolBar( Axis.X )
toolbar.Style = Self.Style.Copy()
toolbar.Style.BackgroundColor = Color.Grey
toolbar.MinSize = New Vec2i( 200,32 )
AddView( toolbar, "top", "32", False )
Local scroll := New ScrollView
scroll.Style = Self.Style.Copy()
scroll.Style.BackgroundColor = Color.Grey
AddView( scroll, "right", "400", True )
Style.BackgroundColor = Color.DarkGrey
End
End
It's a bug - order of #import shouldn't matter, the module.json files describe module dependancies and those look OK so no idea right now.
On Wed, Sep 6, 2017 at 6:26 PM, DoctorWhoof [email protected] wrote:
In the code below, try swapping the lines that import mojox and mojo. The little separator that allows you to drag the view side to side will not show up.
Not sure if a bug or just a side effect from how the import system works, but it definitely took me a while to catch...
#Import "
" #Import " " '<------- Try Importing mojox BEFORE mojo, and the ScrollView won't resize like it should Using std.. Using mojo.. Using mojox..
Function Main() New AppInstance New TestWindow App.Run() End
Class TestWindow Extends Window Public Method New() Super.New( "Test", 800, 600, WindowFlags.Resizable ) Local dock := New GameDock ContentView = dock End End
Class GameDock Extends DockingView Method New() Local toolbar := New ToolBar( Axis.X ) toolbar.Style = Self.Style.Copy() toolbar.Style.BackgroundColor = Color.Grey toolbar.MinSize = New Vec2i( 200,32 ) AddView( toolbar, "top", "32", False )
Local scroll := New ScrollView scroll.Style = Self.Style.Copy() scroll.Style.BackgroundColor = Color.Grey AddView( scroll, "right", "400", True ) Style.BackgroundColor = Color.DarkGrey
End End```
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/blitz-research/monkey2/issues/215, or mute the thread https://github.com/notifications/unsubscribe-auth/ADU3QiKvrKUYmzWAhEWlAPRxQF3BXcTkks5sfjsQgaJpZM4PN5g0 .
Perhaps the assets folder is not populated in module dependency order? Will check.