Back to index

python3.2  3.2.2
Public Member Functions
tkinter.tix.tixCommand Class Reference
Inheritance diagram for tkinter.tix.tixCommand:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def tix_addbitmapdir
def tix_cget
def tix_configure
def tix_filedialog
def tix_getbitmap
def tix_getimage
def tix_option_get
def tix_resetoptions

Detailed Description

The tix commands provide access to miscellaneous  elements
of  Tix's  internal state and the Tix application context.
Most of the information manipulated by these  commands pertains
to  the  application  as a whole, or to a screen or
display, rather than to a particular window.

This is a mixin class, assumed to be mixed to Tkinter.Tk
that supports the self.tk.call method.

Definition at line 78 of file tix.py.


Member Function Documentation

def tkinter.tix.tixCommand.tix_addbitmapdir (   self,
  directory 
)
Tix maintains a list of directories under which
the  tix_getimage  and tix_getbitmap commands will
search for image files. The standard bitmap  directory
is $TIX_LIBRARY/bitmaps. The addbitmapdir command
adds directory into this list. By  using  this
command, the  image  files  of an applications can
also be located using the tix_getimage or tix_getbitmap
command.

Definition at line 89 of file tix.py.

00089 
00090     def tix_addbitmapdir(self, directory):
00091         """Tix maintains a list of directories under which
00092         the  tix_getimage  and tix_getbitmap commands will
00093         search for image files. The standard bitmap  directory
00094         is $TIX_LIBRARY/bitmaps. The addbitmapdir command
00095         adds directory into this list. By  using  this
00096         command, the  image  files  of an applications can
00097         also be located using the tix_getimage or tix_getbitmap
00098         command.
00099         """
00100         return self.tk.call('tix', 'addbitmapdir', directory)

def tkinter.tix.tixCommand.tix_cget (   self,
  option 
)
Returns  the  current  value  of the configuration
option given by option. Option may be  any  of  the
options described in the CONFIGURATION OPTIONS section.

Definition at line 101 of file tix.py.

00101 
00102     def tix_cget(self, option):
00103         """Returns  the  current  value  of the configuration
00104         option given by option. Option may be  any  of  the
00105         options described in the CONFIGURATION OPTIONS section.
00106         """
00107         return self.tk.call('tix', 'cget', option)

def tkinter.tix.tixCommand.tix_configure (   self,
  cnf = None,
  kw 
)
Query or modify the configuration options of the Tix application
context. If no option is specified, returns a dictionary all of the
available options.  If option is specified with no value, then the
command returns a list describing the one named option (this list
will be identical to the corresponding sublist of the value
returned if no option is specified).  If one or more option-value
pairs are specified, then the command modifies the given option(s)
to have the given value(s); in this case the command returns an
empty string. Option may be any of the configuration options.

Definition at line 108 of file tix.py.

00108 
00109     def tix_configure(self, cnf=None, **kw):
00110         """Query or modify the configuration options of the Tix application
00111         context. If no option is specified, returns a dictionary all of the
00112         available options.  If option is specified with no value, then the
00113         command returns a list describing the one named option (this list
00114         will be identical to the corresponding sublist of the value
00115         returned if no option is specified).  If one or more option-value
00116         pairs are specified, then the command modifies the given option(s)
00117         to have the given value(s); in this case the command returns an
00118         empty string. Option may be any of the configuration options.
00119         """
00120         # Copied from Tkinter.py
00121         if kw:
00122             cnf = _cnfmerge((cnf, kw))
00123         elif cnf:
00124             cnf = _cnfmerge(cnf)
00125         if cnf is None:
00126             cnf = {}
00127             for x in self.tk.split(self.tk.call('tix', 'configure')):
00128                 cnf[x[0][1:]] = (x[0][1:],) + x[1:]
00129             return cnf
00130         if isinstance(cnf, StringType):
00131             x = self.tk.split(self.tk.call('tix', 'configure', '-'+cnf))
00132             return (x[0][1:],) + x[1:]
00133         return self.tk.call(('tix', 'configure') + self._options(cnf))

Here is the call graph for this function:

def tkinter.tix.tixCommand.tix_filedialog (   self,
  dlgclass = None 
)
Returns the file selection dialog that may be shared among
different calls from this application.  This command will create a
file selection dialog widget when it is called the first time. This
dialog will be returned by all subsequent calls to tix_filedialog.
An optional dlgclass parameter can be passed to specified what type
of file selection dialog widget is desired. Possible options are
tix FileSelectDialog or tixExFileSelectDialog.

Definition at line 134 of file tix.py.

00134 
00135     def tix_filedialog(self, dlgclass=None):
00136         """Returns the file selection dialog that may be shared among
00137         different calls from this application.  This command will create a
00138         file selection dialog widget when it is called the first time. This
00139         dialog will be returned by all subsequent calls to tix_filedialog.
00140         An optional dlgclass parameter can be passed to specified what type
00141         of file selection dialog widget is desired. Possible options are
00142         tix FileSelectDialog or tixExFileSelectDialog.
00143         """
00144         if dlgclass is not None:
00145             return self.tk.call('tix', 'filedialog', dlgclass)
00146         else:
00147             return self.tk.call('tix', 'filedialog')

def tkinter.tix.tixCommand.tix_getbitmap (   self,
  name 
)
Locates a bitmap file of the name name.xpm or name in one of the
bitmap directories (see the tix_addbitmapdir command above).  By
using tix_getbitmap, you can avoid hard coding the pathnames of the
bitmap files in your application. When successful, it returns the
complete pathname of the bitmap file, prefixed with the character
'@'.  The returned value can be used to configure the -bitmap
option of the TK and Tix widgets.

Definition at line 148 of file tix.py.

00148 
00149     def tix_getbitmap(self, name):
00150         """Locates a bitmap file of the name name.xpm or name in one of the
00151         bitmap directories (see the tix_addbitmapdir command above).  By
00152         using tix_getbitmap, you can avoid hard coding the pathnames of the
00153         bitmap files in your application. When successful, it returns the
00154         complete pathname of the bitmap file, prefixed with the character
00155         '@'.  The returned value can be used to configure the -bitmap
00156         option of the TK and Tix widgets.
00157         """
00158         return self.tk.call('tix', 'getbitmap', name)

def tkinter.tix.tixCommand.tix_getimage (   self,
  name 
)
Locates an image file of the name name.xpm, name.xbm or name.ppm
in one of the bitmap directories (see the addbitmapdir command
above). If more than one file with the same name (but different
extensions) exist, then the image type is chosen according to the
depth of the X display: xbm images are chosen on monochrome
displays and color images are chosen on color displays. By using
tix_ getimage, you can avoid hard coding the pathnames of the
image files in your application. When successful, this command
returns the name of the newly created image, which can be used to
configure the -image option of the Tk and Tix widgets.

Definition at line 159 of file tix.py.

00159 
00160     def tix_getimage(self, name):
00161         """Locates an image file of the name name.xpm, name.xbm or name.ppm
00162         in one of the bitmap directories (see the addbitmapdir command
00163         above). If more than one file with the same name (but different
00164         extensions) exist, then the image type is chosen according to the
00165         depth of the X display: xbm images are chosen on monochrome
00166         displays and color images are chosen on color displays. By using
00167         tix_ getimage, you can avoid hard coding the pathnames of the
00168         image files in your application. When successful, this command
00169         returns the name of the newly created image, which can be used to
00170         configure the -image option of the Tk and Tix widgets.
00171         """
00172         return self.tk.call('tix', 'getimage', name)

def tkinter.tix.tixCommand.tix_option_get (   self,
  name 
)
Gets  the options  maintained  by  the  Tix
scheme mechanism. Available options include:

    active_bg       active_fg      bg
    bold_font       dark1_bg       dark1_fg
    dark2_bg        dark2_fg       disabled_fg
    fg              fixed_font     font
    inactive_bg     inactive_fg    input1_bg
    input2_bg       italic_font    light1_bg
    light1_fg       light2_bg      light2_fg
    menu_font       output1_bg     output2_bg
    select_bg       select_fg      selector

Definition at line 173 of file tix.py.

00173 
00174     def tix_option_get(self, name):
00175         """Gets  the options  maintained  by  the  Tix
00176         scheme mechanism. Available options include:
00177 
00178             active_bg       active_fg      bg
00179             bold_font       dark1_bg       dark1_fg
00180             dark2_bg        dark2_fg       disabled_fg
00181             fg              fixed_font     font
00182             inactive_bg     inactive_fg    input1_bg
00183             input2_bg       italic_font    light1_bg
00184             light1_fg       light2_bg      light2_fg
00185             menu_font       output1_bg     output2_bg
00186             select_bg       select_fg      selector
00187             """
00188         # could use self.tk.globalgetvar('tixOption', name)
00189         return self.tk.call('tix', 'option', 'get', name)

def tkinter.tix.tixCommand.tix_resetoptions (   self,
  newScheme,
  newFontSet,
  newScmPrio = None 
)
Resets the scheme and fontset of the Tix application to
newScheme and newFontSet, respectively.  This affects only those
widgets created after this call. Therefore, it is best to call the
resetoptions command before the creation of any widgets in a Tix
application.

The optional parameter newScmPrio can be given to reset the
priority level of the Tk options set by the Tix schemes.

Because of the way Tk handles the X option database, after Tix has
been has imported and inited, it is not possible to reset the color
schemes and font sets using the tix config command.  Instead, the
tix_resetoptions command must be used.

Definition at line 190 of file tix.py.

00190 
00191     def tix_resetoptions(self, newScheme, newFontSet, newScmPrio=None):
00192         """Resets the scheme and fontset of the Tix application to
00193         newScheme and newFontSet, respectively.  This affects only those
00194         widgets created after this call. Therefore, it is best to call the
00195         resetoptions command before the creation of any widgets in a Tix
00196         application.
00197 
00198         The optional parameter newScmPrio can be given to reset the
00199         priority level of the Tk options set by the Tix schemes.
00200 
00201         Because of the way Tk handles the X option database, after Tix has
00202         been has imported and inited, it is not possible to reset the color
00203         schemes and font sets using the tix config command.  Instead, the
00204         tix_resetoptions command must be used.
00205         """
00206         if newScmPrio is not None:
00207             return self.tk.call('tix', 'resetoptions', newScheme, newFontSet, newScmPrio)
00208         else:
00209             return self.tk.call('tix', 'resetoptions', newScheme, newFontSet)


The documentation for this class was generated from the following file: