Skip to content

Instantly share code, notes, and snippets.

@un1versal
Created July 24, 2016 06:55
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 un1versal/bda2238593976d1bbdbf3510019c6df1 to your computer and use it in GitHub Desktop.
Save un1versal/bda2238593976d1bbdbf3510019c6df1 to your computer and use it in GitHub Desktop.
%widget = $new(widget)
# This is the main container for other elements.
%widget->$setWindowTitle("This is the widget title")
%box=$new(vbox,%widget)
%buttons=$new(buttongroup,%widget)
%layout=$new(layout,%buttons)
%layout->$addWidget(%buttons,0,0)
%label = $new(label,%buttons)
%label->$setText("I would like to have")
%radiobtn1 = $new(radiobutton,%buttons)
%radiobtn1->$setText("A coffee")
privateimpl(%radiobtn1,1)
{
echo OK Ill make a coffee then
return;
}
objects.connect %radiobtn1 toggled %radiobtn1 1
%radiobtn2 = $new(radiobutton,%buttons)
%radiobtn2->$setText("A tea")
privateimpl(%radiobtn2,2)
{
echo OK Ill make a tea then
return;
}
objects.connect %radiobtn2 toggled %radiobtn2 2
%radiobtn3 = $new(radiobutton,%buttons)
%radiobtn3->$setText("A hot chocolate")
privateimpl(%radiobtn3,3)
{
echo OK Ill make a hot chocolate then
stop
}
objects.connect %radiobtn3 toggled %radiobtn3 3
%radiobtn4 = $new(radiobutton,%buttons)
%radiobtn4->$setText("A glass of water")
privateimpl(%radiobtn4,4)
{
echo OK Ill have a water then
}
objects.connect %radiobtn4 toggled %radiobtn4 4
%button = $new(button, %box)
%button->$setText("Close me")
privateimpl(%widget,closeMe)
{
delete $$
}
objects.connect %button clicked %widget closeMe
%widget->$show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment