home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!ogicse!psgrain!charnel!sifon!thunder.mcrcim.mcgill.edu!mouse
- From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
- Newsgroups: comp.windows.x
- Subject: Re: how to create a button using XLIB????
- Message-ID: <1992Nov7.113029.21194@thunder.mcrcim.mcgill.edu>
- Date: 7 Nov 92 11:30:29 GMT
- Article-I.D.: thunder.1992Nov7.113029.21194
- References: <5NOV199210570324@mary.fordham.edu>
- Distribution: na
- Organization: McGill Research Centre for Intelligent Machines
- Lines: 40
-
- In article <5NOV199210570324@mary.fordham.edu>, sbhatia@mary.fordham.edu (SABU) writes:
-
- > Could anybody out there guide me as to how one goes about creating
- > buttons using XLIB.
-
- There are two basic approaches, one being to make each button a window
- of its own, the other being to use one window for multiple buttons and
- do the last level of even distribution in the client instead. My X CD
- player uses the former approach; ups uses the latter.
-
- > The issues that I am very interested in are for ex-: who supplies the
- > colormap, the caller or does the button widget create it's own
- > colormap.
-
- If you're using Xlib, there are no widgets, in the usual sense of the
- term. Are you sure you asked the question you meant to ask?
-
- > How to change the color of the button when user points to it and
- > presses the mouse button.
-
- Typically, just redraw the button's contents with the foreground and
- background colors interchanged. (If you *are* using widgets rather
- than Xlib, I'd expect the widget to do this for you.)
-
- > How do you handle expose events, like for example, I create a button
- > to quit. I place it on some window, but that window gets covered by
- > another window when I raise this window I would like to restre the
- > contents of the button.
-
- If you're writing in Xlib, you just need to ensure that the code that
- handles Expose events knows about the window in which the button is
- drawn and redraws it (or calls whatever code is responsible for
- redrawing it). If you're using a button widget of some sort, from my
- understanding of widgets, I'd expect the widget to deal with that for
- you.
-
- der Mouse
-
- mouse@larry.mcrcim.mcgill.edu
-