Querying widget options Once created the value of some of the options specified for the widget may be queried. This is particularly useful for checking the current contents of user alterable widgets as it avoids the necessity of using the widget's click procedure to store the value in a global variable. procedure :query name argument argument defines which option value is to be returned from the widget known by name. The options that can be queried are determined by the type of widget. Unless specified otherwise the definition of the procedure which created the widget should be referenced for a definition of the arguments. Widget type frame arguments returned value :label string :w number :h number :busy T|F see footer description Widget type panel arguments returned value :w number :h number Widget type button arguments returned value :busy T|F T when button shows sunken :label string Widget type text arguments returned value :label string :w number :value string Widget type list arguments returned value :strings list :selected list :selstrings list :selected returns the indices of the currently selected (highlighted) list entries. :selstrings returns the strings in the currently selected (highlighted) list entries. Widget type galley arguments returned value :strings list Widget type message arguments returned value :label string Widget type checkbox arguments returned value :label string :value 0/1 Widget type number arguments returned value :label string :min value :max value :value value Widget type gauge arguments returned value :label string :value value :min value :max value :min-tick-value value :max-tick-value value Widget type slider arguments returned value :label string :value value :min value :max value Widget type menubutton arguments returned value :label string :rows value :strings list :menu list Widget type optionbutton arguments returned value :strings/:menu list :label /:string string :value value :label returns the currently showing label. i.e. the string that is the current option item. :string is an alias for :label. :value returns the index of the current option item within the option list. Widget type choice arguments returned value :label string :value value :string/:strings string/list :string (or :strings) returns the string or a list of strings corresponding to the current value of the widget. If :exclusive is True a single string is always returned. If :exclusIve is False a list of strings can be returned. :strings is simply an alias for :string but looks more meaningful in a script where :exclusive is False. Widget type choice-stack arguments returned value :label string :rows value :strings list :menu list :value value :string string :string returns the string from the choice menu whose index is the current value of the widget. Widget type canvas arguments returned value :w number :h number