Download presentation
Presentation is loading. Please wait.
Published byThomasina Hines Modified over 9 years ago
1
Advanced BioPSE NCRR SCIRun GUI Guidelines J. Davison de St. Germain Chief Software Engineer SCI Institute 801-581-4078 December 2003 J. Davison de St. Germain Chief Software Engineer SCI Institute 801-581-4078 December 2003 dav@sci.utah.edu
2
Advanced BioPSE NCRR Important Elements Button Panel - Execute - Close - Find Execution Policy - Interactive/Delayed Tab notebook
3
Advanced BioPSE NCRR Helper Utilities Can be found in./SCIRun/src/Dataflow/GUI/ - SciDialog.tcl proc createSciDialog - SciButtonPanel.tcl proc makeSciButtonPanel - SciMoveToCursor.tcl proc moveToCursor
4
Advanced BioPSE NCRR How To Use TCL/Tk Sketch on paper first Use frames liberally - Grooves and padding are your friends. Resize the window often during creation - This will help you make sure that resizing works the way you want it to for the end product.
5
Advanced BioPSE NCRR My Last Tip: Use Tooltips! SCIRun now has tooltips! As you create your GUI, add extensive tooltips to everything! The user can turn them off once they know everything. Convenience functions can be found in:./SCIRun/src/Dataflow/GUI/Tooltips.tcl
6
Advanced BioPSE NCRR Tcl/Tk Packing Example method ui {} { # create a local variable named ‘w’ for # easier reference. Modname is unique to each GUI: set w.ui[modname] # Create a frame called main_window frame $w.main_window # Pack the winow (make it appear) and tell it to grow when # the window is resized. Give it a groove to make it stand out. pack $w.main_window -expand yes -fill both -relief groove -borderwidth 2 # Create a button with text “Do it” that runs the given command button $w.main_window.doit -text “Do it” -command “run this command” # Add a tool tip to the command Tooltip $w.main_window.doit “Press this button to do…” # Add on the common Sci Buttons (Execute, Close, Find) makeSciButtonPanel $w $w $this # Move the window to be near the cursor. moveToCursor $w }
7
Advanced BioPSE NCRR Tcl/Tk, Itcl/Itk Web Pages http://www.tcl.tk/man/tcl8.3/ - Button, canvas, checkbutton, label, menu, scrollbar, text, etc Itcl/itk - Used to help organize tcl code - http://incrtcl.sourceforge.net/itcl http://incrtcl.sourceforge.net/itcl - http://incrtcl.sourceforge.net/itk
8
Advanced BioPSE NCRR GuiVars GuiVars connect C++ code with TCL code (so programmer doesn’t have to.) - GuiString - GuiInt - GuiDouble - Etc. C++ side: - variable.get(), variable.set() Tcl/Tk side: - $this-variable
9
Advanced BioPSE NCRR Questions
10
Advanced BioPSE NCRR
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.