home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / man / cat1 / editres.0 < prev    next >
Encoding:
Text File  |  1996-10-17  |  19.8 KB  |  595 lines

  1.  
  2.  
  3.  
  4. EDITRES(1)                           EDITRES(1)
  5.  
  6.  
  7. NNAAMMEE
  8.        editres - a dynamic resource editor for X Toolkit applica-
  9.        tions
  10.  
  11. SSYYNNTTAAXX
  12.        eeddiittrreess [ _-_t_o_o_l_k_i_t_o_p_t_i_o_n ... ]
  13.  
  14. OOPPTTIIOONNSS
  15.        _E_d_i_t_r_e_s accepts all of the standard X Toolkit command line
  16.        options (see _X_(_1_)).  The order of the command line options
  17.        is not important.
  18.  
  19. DDEESSCCRRIIPPTTIIOONN
  20.        Editres is a tool that allows users and application devel-
  21.        opers  to  view the full widget hierarchy of any X Toolkit
  22.        application that speaks the Editres  protocol.    In  addi-
  23.        tion, editres will help the user construct resource speci-
  24.        fications, allow the user to apply  the    resource  to  the
  25.        application  and     view  the results dynamically.     Once the
  26.        user is happy with a resource specification  editres  will
  27.        append the resource string to the user's X Resources file.
  28.  
  29. UUSSIINNGG EEDDIITTRREESS
  30.        _E_d_i_t_r_e_s provides a window consisting of the following four
  31.        areas:
  32.  
  33.        Menu Bar            A  set    of popup menus that allow
  34.                 you full access to editres's fea-
  35.                 tures.
  36.  
  37.        Panner            The  panner  allows  a more intu-
  38.                 itive way to scroll the     applica-
  39.                 tion tree display.
  40.  
  41.        Message Area        Displays  information to the user
  42.                 about  the  action  that  editres
  43.                 expects of her.
  44.  
  45.        Application Widget Tree    This area will be used to display
  46.                 the selected application's widget
  47.                 tree.
  48.  
  49.        To  begin  an  editres  session select the GGeett WWiiddggeett TTrreeee
  50.        menu item from the command menu.      This    will  change  the
  51.        pointer    cursor    to cross hair.    You should now select the
  52.        application you wish look at by clicking     on  any  of  its
  53.        windows.     If this application understands the editres pro-
  54.        tocol then editres will display the  application's  widget
  55.        tree  in     its  tree  window.   If the application does not
  56.        understand the editres protocol editres will inform you of
  57.        this fact in the message area after a few seconds delay.
  58.  
  59.        Once  you have a widget tree you may now select any of the
  60.        other menu  options.  The  effect  of  each  of    these  is
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. EDITRES(1)                           EDITRES(1)
  71.  
  72.  
  73.        described below.
  74.  
  75. CCOOMMMMAANNDDSS
  76.        Get Widget Tree
  77.            Allows  the  user to click on any application that
  78.            speaks the editres protocol and receive its widget
  79.            tree.
  80.  
  81.        Refresh Current Widget Tree
  82.            Editres only knows about the widgets that exist at
  83.            the present time.  Many    applications  create  and
  84.            destroy    widgets     on the fly.  Selecting this menu
  85.            item will cause editres to ask the application  to
  86.            resend its widget tree, thus updating its informa-
  87.            tion to the new state of the application.
  88.  
  89.            For example, xman only creates the widgets for its
  90.            _t_o_p_b_o_x when it starts up.  None of the widgets for
  91.            the manual page window are created until the  user
  92.            actually clicks on the _M_a_n_u_a_l _P_a_g_e button.  If you
  93.            retrieved xman's widget tree before the the manual
  94.            page is active, you may wish to refresh the widget
  95.            tree after the manual  page  has     been  displayed.
  96.            This will allow you to also edit the manual page's
  97.            resources.
  98.  
  99.        Dump Widget Tree to a File
  100.            For documenting applications it is often useful to
  101.            be able to dump the entire application widget tree
  102.            to an ASCII file.  This file can then be     included
  103.            in  the    manual    page.    When  this  menu  item is
  104.            selected a popup dialog is  activated.    Type  the
  105.            name of the file in this dialog, and either select
  106.            _o_k_a_y, or type a carriage-return.     Editres will now
  107.            dump  the widget tree to this file.  To cancel the
  108.            file dialog, select the _c_a_n_c_e_l button.
  109.  
  110.        Show Resource Box
  111.            This command will popup a  resource  box     for  the
  112.            current application.  This resource box (described
  113.            in detail  below)  will    allow  the  user  to  see
  114.            exactly    which resources can be set for the widget
  115.            that is currently selected in the widget tree dis-
  116.            play.   Only one widget may be currently selected;
  117.            if greater or  fewer  are  selected  editres  will
  118.            refuse to pop up the resource box and put an error
  119.            message in the MMeessssaaggee AArreeaa.
  120.  
  121.        Set Resource
  122.            This command will popup a simple     dialog     box  for
  123.            setting an arbitrary resource on all selected wid-
  124.            gets.  You must type in the resource name, as well
  125.            as  the    value.    You can use the Tab key to switch
  126.            between the resource name field the resource value
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. EDITRES(1)                           EDITRES(1)
  137.  
  138.  
  139.            field.
  140.  
  141.        Quit    Exits editres.
  142.  
  143. TTRREEEE CCOOMMMMAANNDDSS
  144.        The  TTrreeee menu contains several commands that allow opera-
  145.        tions to be performed on the widget tree.
  146.  
  147.        Select Widget in Client
  148.           This menu item allows you to select any  widget  in
  149.           the  application;     editres  will then highlight the
  150.           corresponding  element  the  widget  tree     display.
  151.           Once  this menu item is selected the pointer cursor
  152.           will again turn to a crosshair, and you must  click
  153.           any  pointer  button in the widget you wish to have
  154.           displayed.  Since some widgets are  fully     obscured
  155.           by  their     children,  it    is not possible to get to
  156.           every widget this way, but this mechanism does give
  157.           very  useful  feedback  between the elements in the
  158.           widget tree and those in the actual application.
  159.  
  160.        Select All
  161.        Unselect All
  162.        Invert All
  163.           These functions allow the user to select, unselect,
  164.           or invert all widgets in the widget tree.
  165.  
  166.        Select Children
  167.        Select Parents
  168.           These  functions    select    the  immediate    parent or
  169.           children of each of the currently selected widgets.
  170.  
  171.        Select Descendants
  172.        Select Ancestors
  173.           These  functions    select all parents or children of
  174.           each of the currently selected widgets.  This is    a
  175.           recursive search.
  176.  
  177.        Show Widget Names
  178.        Show Class Names
  179.        Show Widget Windows
  180.           When  the     tree  widget  is initially displayed the
  181.           labels of each widget in the tree correspond to the
  182.           widget names.  These functions will cause the label
  183.           of aallll widgets in the tree to be    changed     to  show
  184.           the class name, IDs, or window associated with each
  185.           widget in the application.   The    widget    IDs,  and
  186.           windows are shown as hex numbers.
  187.  
  188.        In  addition  there  are keyboard accelerators for each of
  189.        the Tree operations.  If the input focus is over an  indi-
  190.        vidual  widget  in the tree, then that operation will only
  191.        effect that widget.  If the input focus    is  in    the  Tree
  192.        background  it  will  have  exactly the same effect as the
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. EDITRES(1)                           EDITRES(1)
  203.  
  204.  
  205.        corresponding menu item.
  206.  
  207.        The translation entries shown may be applied to any widget
  208.        in the application.  If that widget is a child of the Tree
  209.        widget, then it will only affect that widget, otherwise it
  210.        will  have  the    same  effect  as the commands in the tree
  211.        menu.
  212.  
  213.        Flash Active Widgets
  214.           This command is the inverse of the SSeelleecctt WWiiddggeett iinn
  215.           CClliieenntt  command,    it will show the user each widget
  216.           that is currently selected in the widget    tree,  by
  217.           flashing    the  corresponding widget in the applica-
  218.           tion _n_u_m_F_l_a_s_h_e_s (three by     default)  times  in  the
  219.           _f_l_a_s_h_C_o_l_o_r.
  220.  
  221.            KKeeyy         OOppttiioonn              TTrraannssllaattiioonn EEnnttrryy
  222.  
  223.            space     Unselect              Select(nothing)
  224.            w         Select              Select(widget)
  225.            s         Select              Select(all)
  226.            i         Invert              Select(invert)
  227.            c         Select Children          Select(children)
  228.            d         Select Descendants          Select(descendants)
  229.            p         Select Parent          Select(parent)
  230.            a         Select Ancestors          Select(ancestors)
  231.            N         Show Widget Names          Relabel(name)
  232.            C         Show Class Names          Relabel(class)
  233.            I         Show Widget IDs          Relabel(id)
  234.            W         Show Widget Windows      Relabel(window)
  235.            T         Toggle Widget/Class Name Relabel(toggle)
  236.  
  237.           Clicking button 1 on a widget adds it to the set of
  238.           selected widgets.     Clicking button 2  on    a  widget
  239.           deselects     all  other widgets and then selects just
  240.           that widget.  Clicking button 3 on a widget toggles
  241.           its  label  between  the widget's instance name the
  242.           widget's class name.
  243.  
  244.  
  245. UUSSIINNGG TTHHEE RREESSOOUURRCCEE BBOOXX
  246.        The resource box contains five different areas.     Each  of
  247.        the  areas, as they appear on the screen, from top to bot-
  248.        tom will be discussed.
  249.  
  250.        The Resource Line
  251.           This area at the top of the resource box shows  the
  252.           current resource name exactly as it would appear if
  253.           you were to save it to a file or apply it.
  254.  
  255.        The Widget Names and Classes
  256.           This area allows you to select exactly  which  wid-
  257.           gets  this  resource  will apply to.  The area con-
  258.           tains four lines, the first contains  the     name  of
  259.  
  260.  
  261.  
  262. X Version 11           Release 6.1                4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. EDITRES(1)                           EDITRES(1)
  269.  
  270.  
  271.           the  selected widget and all its ancestors, and the
  272.           more restrictive dot  (..)     separator.   The  second
  273.           line contains less specific the Class names of each
  274.           widget, and well as the less restrictive    star  (**)
  275.           separator.   The    third line contains a set of spe-
  276.           cial buttons called AAnnyy WWiiddggeett which will     general-
  277.           ize  this level to match any widget.  The last line
  278.           contains a set of special buttons called AAnnyy WWiiddggeett
  279.           CChhaaiinn  which  will turn the single level into some-
  280.           thing that matches zero or more levels.
  281.  
  282.           The initial state of this area is the most restric-
  283.           tive,  using the resource names and the dot separa-
  284.           tor.  By selecting the other buttons in  this  area
  285.           you  can    ease  the  restrictions to allow more and
  286.           more  widgets  to     match    the  specification.   The
  287.           extreme  case is to select all the AAnnyy WWiiddggeett CChhaaiinn
  288.           buttons, which  will  match  every  widget  in  the
  289.           application.    As you select different buttons the
  290.           tree display will update to show you exactly  which
  291.           widgets  will  be     effected by the current resource
  292.           specification.
  293.  
  294.        Normal and Constraint Resources
  295.           The next area allows you to select the name of  the
  296.           normal  or  constraint  resources     you wish to set.
  297.           Some widgets may not have constraint resources,  so
  298.           that area will not appear.
  299.  
  300.        Resource Value
  301.           This  next  area    allows    you to enter the resource
  302.           value.  This value should be entered exactly as you
  303.           would type a line into your resource file.  Thus it
  304.           should contain no unescaped new-lines.  There are a
  305.           few special character sequences for this file:
  306.  
  307.           \n - This will be replaced with a newline.
  308.  
  309.           \###  -  Where  # is any octal digit.  This will be
  310.           replaced with a  single  byte  that  contains  this
  311.           sequence interpreted as an octal number.    For exam-
  312.           ple, a value containing a NULL byte can  be  stored
  313.           by specifying \000.
  314.  
  315.           \<new-line> - This will compress to nothing.
  316.  
  317.           \\ - This will compress to a single backslash.
  318.  
  319.        Command Area
  320.           This   area   contains   several    command     buttons,
  321.           described in this section.
  322.  
  323.        Set Save File
  324.           This button allows the user to modify file that the
  325.  
  326.  
  327.  
  328. X Version 11           Release 6.1                5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. EDITRES(1)                           EDITRES(1)
  335.  
  336.  
  337.           resources will be saved to.  This button will bring
  338.           up a dialog box that will ask you for  a    filename;
  339.           once the filename has been entered, either hit car-
  340.           riage-return or click on the _o_k_a_y button.      To  pop
  341.           down the dialog box without changing the save file,
  342.           click the _c_a_n_c_e_l button.
  343.  
  344.        Save   This button will append the rreessoouurrccee lliinnee described
  345.           above  to     the end of the current save file.  If no
  346.           save file has been set the SSeett SSaavvee FFiillee dialog box
  347.           will  be    popped    up to prompt the user for a file-
  348.           name.
  349.  
  350.        Apply  This button attempts to perform a XtSetValues  call
  351.           on   all    widgets     that  match  the  rreessoouurrccee  lliinnee
  352.           described above.    The value  specified  is  applied
  353.           directly to all matching widgets.     This behavior is
  354.           an attempt to give a dynamic feel to  the     resource
  355.           editor.    Since this feature allows users to put an
  356.           application in states it may not be willing to han-
  357.           dle,  a  hook  has  been provided to allow specific
  358.           applications to block these SetValues requests (see
  359.           BBlloocckkiinngg EEddiittrreess RReeqquueessttss below).
  360.  
  361.           Unfortunately  due to design constraints imposed on
  362.           the widgets by the X Toolkit and the Resource  Man-
  363.           ager,  trying to coerce an inherently static system
  364.           into dynamic behavior can     cause    strange     results.
  365.           There  is no guarantee that the results of an apply
  366.           will be the same as what will happen when you  save
  367.           the  value and restart the application.  This func-
  368.           tionality is provided to try to give  you     a  rough
  369.           feel for what your changes will accomplish, and the
  370.           results obtained should be  considered  suspect  at
  371.           best.  Having said that, this is one of the neatest
  372.           features of editres, and I  strongly  suggest  that
  373.           you play with it, and see what it can do.
  374.  
  375.        Save and Apply
  376.           This  button  combines  the  Save and Apply actions
  377.           described above into one button.
  378.  
  379.        Popdown Resource Box
  380.           This button will remove the resource box    from  the
  381.           display.
  382.  
  383. BBLLOOCCKKIINNGG EEDDIITTRREESS RREEQQUUEESSTTSS
  384.        The editres protocol has been built into the Athena Widget
  385.        set.  This allows all applications that are linked against
  386.        Xaw  to    be  able  to speak to the resource editor.  While
  387.        this provides great flexibility, and is a useful tool,  it
  388.        can  quite easily be abused.  It is therefore possible for
  389.        any Xaw application to specify a value  for  the     eeddiittrreess--
  390.        BBlloocckk  resource    described  below,  to  keep  editres from
  391.  
  392.  
  393.  
  394. X Version 11           Release 6.1                6
  395.  
  396.  
  397.  
  398.  
  399.  
  400. EDITRES(1)                           EDITRES(1)
  401.  
  402.  
  403.        divulging information about its internals, or  to  disable
  404.        the SSeettVVaalluueess part of the protocol.
  405.  
  406.        eeddiittrreessBBlloocckk ((Class EEddiittrreessBBlloocckk))
  407.            Specifies  which type of blocking this application
  408.            wishes to impose on the editres protocol.
  409.  
  410.        The accepted values are:
  411.  
  412.        all          Block all requests.
  413.  
  414.        setValues      Block all SetValues requests.  As     this  is
  415.               the only editres request that actually mod-
  416.               ifies the application, this  is  in  effect
  417.               stating  that the application is read-only.
  418.  
  419.        none          Allow all editres requests.
  420.  
  421.        Remember that these resources are set on any Xaw     applica-
  422.        tion,  nnoott eeddiittrreess.  They allow individual applications to
  423.        keep all or some of the requests editres makes  from  ever
  424.        succeeding.   Of     course,  editres is also an Xaw applica-
  425.        tion, so it may also be viewed  and  modified  by  editres
  426.        (rather    recursive, I know), these commands can be blocked
  427.        by setting the eeddiittrreessBBlloocckk resource on editres itself.
  428.  
  429. RREESSOOUURRCCEESS
  430.        For _e_d_i_t_r_e_s the available application resources are:
  431.  
  432.        nnuummFFllaasshheess ((Class NNuummFFllaasshheess))
  433.            Specifies the number of times the widgets  in  the
  434.            application  will  be flashed when the SShhooww AAccttiivvee
  435.            WWiiddggeettss command in invoked.
  436.  
  437.        ffllaasshhTTiimmee ((Class FFllaasshhTTiimmee))
  438.            Amount  of  time     between  the  flashes    described
  439.            above.
  440.  
  441.        ffllaasshhCCoolloorr ((Class ffllaasshhCCoolloorr))
  442.            Specifies the color used to flash application wid-
  443.            gets.  A bright color should  be     used  that  will
  444.            immediately  draw your attention to the area being
  445.            flashed, such as red or yellow.
  446.  
  447.        ssaavveeRReessoouurrcceessFFiillee ((Class SSaavveeRReessoouurrcceessFFiillee))
  448.            This is the file the resource line will be  append
  449.            to  when the SSaavvee button activated in the resource
  450.            box.
  451.  
  452. WWIIDDGGEETTSS
  453.        In order to specify resources, it is useful  to    know  the
  454.        hierarchy  of  the  widgets which compose _e_d_i_t_r_e_s.  In the
  455.        notation below, indentation indicates hierarchical  struc-
  456.        ture.   The  widget class name is given first, followed by
  457.  
  458.  
  459.  
  460. X Version 11           Release 6.1                7
  461.  
  462.  
  463.  
  464.  
  465.  
  466. EDITRES(1)                           EDITRES(1)
  467.  
  468.  
  469.        the widget instance name.
  470.  
  471.        Editres    editres
  472.         Paned  paned
  473.          Box  box
  474.               MenuButton  commands
  475.                SimpleMenu  menu
  476.                SmeBSB  sendTree
  477.                SmeBSB  refreshTree
  478.                SmeBSB  dumpTreeToFile
  479.                SmeLine  line
  480.                SmeBSB  getResourceList
  481.                SmeLine  line
  482.                SmeBSB  quit
  483.               MenuButton  treeCommands
  484.                SimpleMenu  menu
  485.                SmeBSB  showClientWidget
  486.                SmeBSB  selectAll
  487.                SmeBSB  unselectAll
  488.                SmeBSB  invertAll
  489.                SmeLine  line
  490.                SmeBSB  selectChildren
  491.                SmeBSB  selectParent
  492.                SmeBSB  selectDescendants
  493.                SmeBSB  selectAncestors
  494.                SmeLine  line
  495.                SmeBSB  showWidgetNames
  496.                SmeBSB  showClassNames
  497.                SmeBSB  showWidgetIDs
  498.                SmeBSB  showWidgetWindows
  499.                SmeLine  line
  500.                SmeBSB  flashActiveWidgets
  501.          Paned    hPane
  502.               Panner  panner
  503.               Label  userMessage
  504.               Grip  grip
  505.          Porthole  porthole
  506.               Tree  tree
  507.                Toggle  <name of widget in application>
  508.                .
  509.                .
  510.                .
  511.                TransientShell  resourceBox
  512.                Paned  pane
  513.                Label  resourceLabel
  514.                Form     namesAndClasses
  515.                Toggle  dot
  516.                Toggle  star
  517.                Toggle  any
  518.                Toggle  name
  519.                Toggle  class
  520.                 .
  521.                 .
  522.                 .
  523.  
  524.  
  525.  
  526. X Version 11           Release 6.1                8
  527.  
  528.  
  529.  
  530.  
  531.  
  532. EDITRES(1)                           EDITRES(1)
  533.  
  534.  
  535.                Label  namesLabel
  536.                List     namesList
  537.                Label  constraintLabel
  538.                List     constraintList
  539.                Form     valueForm
  540.                Label  valueLabel
  541.                Text     valueText
  542.                Box    commandBox
  543.                Command  setFile
  544.                Command  save
  545.                Command  apply
  546.                Command  saveAndApply
  547.                Command  cancel
  548.                Grip     grip
  549.          Grip  grip
  550.  
  551.  
  552. EENNVVIIRROONNMMEENNTT
  553.        DDIISSPPLLAAYY to get the default host and display number.
  554.  
  555.        XXEENNVVIIRROONNMMEENNTT
  556.            to get the name of a resource file that    overrides
  557.            the     global     resources    stored    in    the
  558.            RESOURCE_MANAGER property.
  559.  
  560. FFIILLEESS
  561.        <XRoot>/lib/X11/app-defaults/Editres - specifies     required
  562.        resources
  563.  
  564. SSEEEE AALLSSOO
  565.        X(1), xrdb(1), Athena Widget Set
  566.  
  567. RREESSTTRRIICCTTIIOONNSS
  568.        This  is     a  prototype, there are lots of nifty features I
  569.        would love to add, but I hope  this  will  give    you  some
  570.        ideas about what a resource editor can do.
  571.  
  572. AAUUTTHHOORR
  573.        Chris D. Peterson, formerly MIT X Consortium
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592. X Version 11           Release 6.1                9
  593.  
  594.  
  595.