You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Martin Prout edited this page Aug 25, 2013
·
13 revisions
Rather than trying to implement the vanilla processing convenience function "selectInput", which relies on dodgy java reflection nonsense, we provide a more ruby like file chooser (built on JFileChooser). Like the control_panel library, the file_chooser takes a block ( instead of a string reflection method ). On linux using openjdk the default look and feel might be preferred.
load_library:file_chooserattr_reader:img############ Example file chooser (in this case image file chooser), # the image loading and resizing is encapsulated in the block.# Borrows heavily from control_panel. ###########defsetupsize600,600file_chooserdo |fc|
fc.look_feel"Nimbus"fc.set_filter"Image Files",[".png",".jpg"]my_file=fc.display@img=load_image(my_file)img.resize(width,height)endenddefdrawimageimg,0,0end