showDialog () # dont forget to actually display the dialog at some point # Show dialog, the rest of the code is not executed before OK or Cancel is clicked addHelp ( r "" ) # clicking the help button will open the provided URL in the default browser # Add a Help button in addition to the default OK/Cancel addNumericField ( "Some integer", 10, 0 ) # 0 for no decimal part addChoice ( "Choose one option among a list", , "Choice1" ) # Choice1 is default here addToSameRow () # The next item is appended next to the tick box addCheckbox ( "This is a tickbox->Activate some option", True ) # We can add elements next to each other using the addToSameRow method addStringField ( "Type some input text :", "initial text" ) gui. addMessage ( "Some information to display at the top of the gui" ) gui. # Elements are stacked on top of each others by default (unless specified) Gui = GenericDialog ( "My first GUI" ) # Add some gui elements (Ok and Cancel button are present by default) From ij.gui import GenericDialog # Create an instance of GenericDialog
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |