This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
draw :text, "To Do:", :font_size => 24 | |
draw :text, "Empty list...", :named => "todo_list", :height => 150 | |
draw :edit_line, :named => "input" | |
draw :button, "Add to list", :named => "clicker" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Func<T, bool> ExBuildEqFuncFor<T>(string prop, object val) | |
{ | |
var o = Expression.Parameter(typeof(T), "t"); | |
Expression<Func<T, bool>> expression = | |
Expression.Lambda<Func<T, bool>>( | |
Expression.Equal( | |
Expression.PropertyOrField(o, prop), | |
Expression.Constant(val)), o); | |
return expression.Compile(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Func<T, bool> BuildEqFuncFor<T>(string prop, object val) | |
{ | |
return t => t.GetType().InvokeMember( | |
prop, BindingFlags.GetProperty, null, t, null) == val; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Func<T, bool> ExBuildEqFuncFor<T>(string prop, object val) | |
{ | |
var o = Expression.Parameter(typeof(T), "t"); | |
Expression<Func<T, bool>> expression = | |
Expression.Lambda<Func<T, bool>>( | |
Expression.Equal( | |
Expression.PropertyOrField(o, prop), | |
Expression.Constant(val)), o); | |
return expression.Compile(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "kiddo" | |
Kiddo.start do | |
draw :stack do | |
draw :text, "Text to reverse:", :font_size => 18 | |
draw :edit_box, :named => "input" | |
draw :text, "Your string will show up here.", :named => "result" | |
draw :button, "Reverse It!", :named => "fun_button" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
draw :text, "Some text to draw", :font_size => 24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "kiddo" | |
Kiddo.start do | |
screen :named => "image_screen" do | |
draw :stack do | |
draw :image, "Penguins.jpg" | |
draw :button, "See info", :named => "see_info" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
after :my_button.is_clicked do | |
# this will be executed after my_button is clicked | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bind :status_dropdown, :to => ["Active", "Inactive", "Asleep"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cherrypy | |
from main import app | |
cherrypy.config.update({'server.socket_host': '0.0.0.0', | |
'server.socket_port': 8080}) | |
cherrypy.tree.graft(app) | |
if __name__ == '__main__': | |
try: | |
cherrypy.engine.start() |
OlderNewer