Path: news.cs.au.dk!not-for-mail From: Peter Andersen Newsgroups: comp.lang.beta Subject: Re: guienv and arguments Date: 29 Mar 1999 11:37:31 -0000 Organization: Mjolner Informatics ApS Lines: 134 Approved: mailtonews@cs.au.dk Distribution: world Message-ID: <19990329113731.17322.qmail@noatun.mjolner.dk> Reply-To: Peter Andersen NNTP-Posting-Host: daimi.cs.au.dk X-Trace: xinwen.cs.au.dk 922707468 374120 255.255.255.255 (29 Mar 1999 11:37:48 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 29 Mar 1999 11:37:48 GMT Xref: news.cs.au.dk comp.lang.beta:11886 Volkher Kaschlun writes: > > Hallo! > While I was writing a program using guienv, which should be started with > some arguments, I noticed, if it was started with the argument -name > followed by another word, these two arguments are lost. .... > > This happens only using guienv. > You are right. This is due to the fact that guienv initializes the X Toolkit with pointers to the original argument lists given to the program, and because the X toolkit interprets certain arguments from that list *and then removes* the arguments from that list. I have added an excerpt from 'man X' below, which explains what arguments are "eaten" by the X toolkit. You might argue that guienv should initialize Xt using *a copy* of the arguments list, thus leaving the arguments in the original list for the program. Well, this is a matter of taste: This means that your program should be prepared to handle arguments like '-geometry 412x233-24+50'. The way it is currently done releaves your program code of handling this, and still allowing the user to use it. Sincerely, Peter Andersen, Mjolner Informatics From 'man X': OPTIONS Most X programs attempt to use the same names for command line options and arguments. All applications written with the X Toolkit Intrinsics automatically accept the following options: -display display This option specifies the name of the X server to use. -geometry geometry This option specifies the initial size and location of the window. -bg color, -background color Either option specifies the color to use for the window background. -bd color, -bordercolor color Either option specifies the color to use for the window border. -bw number, -borderwidth number Either option specifies the width in pixels of the window border. -fg color, -foreground color Either option specifies the color to use for text or graphics. -fn font, -font font Either option specifies the font to use for display- ing text. -iconic This option indicates that the user would prefer that the application's windows initially not be visible as if the windows had be immediately iconi- fied by the user. Window managers may choose not to honor the application's request. -name This option specifies the name under which resources for the application should be found. This option is useful in shell aliases to distinguish between invo- cations of an application, without resorting to creating links to alter the executable file name. -rv, -reverse Either option indicates that the program should simulate reverse video if possible, often by swap- ping the foreground and background colors. Not all programs honor this or implement it correctly. It is usually only used on monochrome displays. +rv This option indicates that the program should not simulate reverse video. This is used to override any defaults since reverse video doesn't always work properly. -selectionTimeout This option specifies the timeout in milliseconds within which two communicating applications must respond to one another for a selection request. -synchronous This option indicates that requests to the X server should be sent synchronously, instead of asynchro- nously. Since Xlib normally buffers requests to the server, errors do not necessarily get reported immediately after they occur. This option turns off the buffering so that the application can be debugged. It should never be used with a working program. -title string This option specifies the title to be used for this window. This information is sometimes used by a window manager to provide some sort of header iden- tifying the window. -xnllanguage language[_territory][.codeset] This option specifies the language, territory, and codeset for use in resolving resource and other filenames. -xrm resourcestring This option specifies a resource name and value to override any defaults. It is also very useful for setting resources that don't have explicit command line arguments.