Re: [gtk-list] How to... Xlib stuff (I think)



In a previous message, Leeman Strout says:
> Okey, how do I get a gtk program to obey cli specs for Xlib stuff?  Such
> as -geom, -iconic, and other assorted things.
> 
> Is there yet another cli parser I need to invoke within the program?

GTK does not have the parser built into the X Toolkit (Xt - its not part of
Xlib).  You have to write your own parser.

One thing you can do is get hold of the GNU getopt_long() parser.  This is
the one that many tools are using to parse options with "--" instead of "-"
prefixes.  Since I couldn't find it (and really didn't want to include GNU
code directly in my code since I was considering making it commercial) I
wrote my own version of it.  If you want a copy let me know.  Its not GPL -
its just plain free.  I think it will drop into any project, but you may
need to tweak it.  It should work just like getopt_long().  It is a single
.c file (no C++ - I don't know how to program in C++), fully commented and
self documented.

If anyone requests it, I'll post it here.  I just didn't think it was
appropriate to do so since its not GTK specific.  If the GTK maintainers
want it, they are welcome to it.
-- 
Michael J. Hammel           | The people who think Tiny Tim is 
The Graphics Muse           | strange are the same ones who think
mjhammel@graphics-muse.org  | it odd that I drive without pants.
http://www.graphics-muse.org 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]