Skip to content

Instantly share code, notes, and snippets.

@jarhart
Created October 20, 2011 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jarhart/1300527 to your computer and use it in GitHub Desktop.
Save jarhart/1300527 to your computer and use it in GitHub Desktop.
class MyScreenBuilder < ScreenBuilder
def initialize(title)
super
controller(DefaultScreenController.new)
layer(MyLayerBuilder.new("Layer_ID"))
end
end
class MyLayerBuilder < LayerBuilder
def initialize(id)
super
childLayoutVertical
panel(MyPanelBuilder.new("Panel_ID"))
end
end
class MyPanelBuilder < PanelBuilder
def initialize(id)
super
childLayoutCenter
control(MyButtonBuilder.new("Button_ID", "Hello Nifty"))
end
end
class MyButtonBuilder < ButtonBuilder
def initialize(id, label)
super
alignCenter
valignCenter
height "5%"
width "15%"
end
end
nifty.addScreen("Screen_ID", MyScreenBuilder.new("Hello Nifty Screen"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment