Path: utzoo!attcan!uunet!ncrlnk!ncr-sd!hp-sdd!ucsdhub!sdcsvax!ucsd!ucbvax!tut.cis.ohio-state.edu!bloom-beacon!bsw.UUCP!adam From: adam@bsw.UUCP (Adam de Boor) Newsgroups: comp.windows.x Subject: translations vs. hard-coding Message-ID: <8906152153.AA11670@promethium.bsw.com> Date: 15 Jun 89 21:53:50 GMT Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 38 Is it just my warped perceptions, or is there a noticeable lack of understanding as far as the power of the "translations" resource goes? In each of the applications I've looked at closely (well, both of them: xpostit and xman), I find things have been hard-coded in that could have been much better done via the translation manager. xpostit, while using a widget for its 3M plaid icon, has a single action to which it binds all button events. The action just calls a callback that says "left button? raise all notes; middle button? lower them all; right button? bring up a menu". There are only three sizes of note you can create, although you can change the size with the window manager (a cumbersome way to provide functionality, I must say). A much better way to perform the task at hand is for the Plaid widget to provide the actions RaiseAll, LowerAll, SaveAll, and MakeNote (which takes two parameters: the height and width in inches). This allows me to bind "Shift" to make myself a 1x1.5 inch note (not one provided by the menu, but just about the right size for me), or "s" to "SaveAll", rather than having to bring up the menu. xman, on the other hand, has a particularly annoying "feature" where it brings up a menu whenever the mouse crosses its title bar. I had hoped to be able to just rebind that to ": MenuPopup(menu)" (that's another thing lacking in xpostit -- the menu is brought up by hand rather than with a MenuPopup action, so there's no way to rebind the event used to bring the thing up), but no. It doesn't even pretend to be flexible (as xpostit does), it just calls XtAddEventHandler. I don't mean this to be a personal attack on the authors of these programs -- xpostit is quite a nice little program now that I've been able to customize it and fix the saving of the note positions so they come up where I so carefully placed them before logging out. Rather, this is a plea for people to recognize the power of the translation and action mechanism and the flexibility it provides. It gave me a warm fuzzy feeling when I was able to change all scrollbars to have what I consider the "right" button bindings (left goes up, right goes down) in all Xaw-using clients by adding three lines to my resources file. Please, folks, let's not make applications overly restrictive, shall we? a