app :: UiExampleWindow :: defaultinit
app :: UiExampleWindow :: h_layout=
Horizontal organizationapp :: UiExampleWindow :: user_input=
Field for the user to enter dataapp :: UiExampleWindow :: user_input_label
Description for theuser_input
app :: UiExampleWindow :: user_input_label=
Description for theuser_input
app $ UiExampleWindow :: SELF
Type of this instance, automatically specialized in every classapp $ UiExampleWindow :: on_event
Notification ofevent
raised by sender
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
gtk :: GtkCallable :: defaultinit
app :: Control :: defaultinit
app :: UiExampleWindow :: defaultinit
app :: AppComponent :: defaultinit
app :: Window :: defaultinit
core :: Object :: defaultinit
app :: CompositeControl :: defaultinit
core :: Finalizable :: defaultinit
app :: AppObserver :: defaultinit
core :: Finalizable :: finalize
Liberate any resources held byself
before the memory holding self
is freed
app :: UiExampleWindow :: h_layout=
Horizontal organizationcore :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
app :: AppComponent :: notify_observers
Propagateevent
to all observers
by calling AppObserver::on_event
app :: AppComponent :: observers
AllAppObserver
notified of events raised by self
app :: AppComponent :: observers=
AllAppObserver
notified of events raised by self
app :: AppComponent :: on_pause
The application leaves the active state but is still partially visibleapp :: AppComponent :: on_restart
The application returns to a visible state from a previouson_stop
app :: AppComponent :: on_restore_state
The application is launching, restore its state from a previouson_save_state
app :: AppComponent :: on_resume
The application enters the active state, it is in the foreground and interactiveapp :: AppComponent :: on_save_state
The application may be destroyed soon, save its state for a futureon_restore_state
app :: AppComponent :: on_start
The application is starting or restarting, it is visible to the usercore :: Object :: output_class_name
Display class name on stdout (debug only).Control
in the control tree
Control
in the control tree
app :: UiExampleWindow :: user_input=
Field for the user to enter dataapp :: UiExampleWindow :: user_input_label
Description for theuser_input
app :: UiExampleWindow :: user_input_label=
Description for theuser_input
app :: AppComponent
An element of an application that is notified of the application life cyclegtk :: GtkCallable
# Window showing off some the available controls
class UiExampleWindow
super Window
# Root layout
var layout = new ListLayout(parent=self)
# Some label
var some_label = new Label(parent=layout, text="Sample Window using a ListLayout.")
# A checkbox
var checkbox = new CheckBox(parent=layout, text="A CheckBox")
# Horizontal organization
var h_layout = new HorizontalLayout(parent=layout)
# Description for the `user_input`
var user_input_label = new Label(parent=h_layout, text="Input some text:", align=0.5)
# Field for the user to enter data
var user_input = new TextInput(parent=h_layout, text="Default text")
# Button to open a new window with a ListLayout
var button_window = new Button(parent=layout, text="Open a new window")
# URL to open
var example_url = "http://nitlanguage.org/"
# Button to open the browser
var button_browser = new Button(parent=layout, text="Open {example_url}")
redef fun on_event(event)
do
if event isa ButtonPressEvent then
if event.sender == button_browser then
example_url.open_in_browser
else if event.sender == button_window then
app.push_window new SecondWindow
end
else if event isa ToggleEvent then
if event.sender == checkbox then checkbox.text = if checkbox.is_checked then "Checked" else "Unchecked"
end
end
end
lib/app/examples/ui_example.nit:29,1--72,3