waashk/20ng huggingface dataset:
A few days ago I posted a question about trying to call a function which set up an X app multiple times.  It was pointed out that XtAppInitialize() should never be called more than once.  This helped.  However, I am still having some problems.  Below is a new little test program that more closely models my real program.  In the actual program, I am writing a library, callable from any other program.  This means that the first time the lib function is called, it must initialize things, and after that, it should just use the old stuff (still around because of static variables).  In the demo below, main() represents the main program calling my library and doit() represents the interface to the library function.  #include <X11/Xlib.h> #include <Xm/Xm.h> #include <Xm/PushB.h> #include <stdio.h> #include <stdlib.h>  void bla(XtAppContext app, Widget top) {         Widget topone = top;		// in real prog, these are member vars         XtAppContext theapp = app;	// of a class         int junk = 0;         Display *dis = XtOpenDisplay(theapp, NULL, NULL, NULL, NULL, 0, &junk,                                         NULL);          Widget box = XtVaCreateManagedWidget("blaaa", xmPushButtonWidgetClass,                         topone,                         XmNheight, 50,                         XmNwidth, 50,                         NULL);          XtRealizeWidget(topone);         for (int i=0;i<=25;i++)	// real prog returns when "Exit" button clicked         {                 XEvent event;                 XtAppNextEvent(theapp, &event);                 XtDispatchEvent(&event);         }         XtDestroyWidget(box);         XtCloseDisplay(dis); }  // SetItUp - should be called once only void SetItUp(XtAppContext *app, Widget *top) {         int junk = 0;         (*top)=XtAppInitialize (app, "test", NULL, 0, &junk, NULL,                 NULL, NULL, 0); }  // doit - some library function callable from the outside void doit() {         static XtAppContext app;	// use these every time called         static Widget top;          static int setup = 0;          if (!setup)         {                 SetItUp(&app, &top);                 setup = 1;         }         bla(app, top); }  // main - program which links to my library main() {         for (int i=0;i<=20;i++)         {                 doit();                 printf("sleeping...\n");//widget still on screen at this point                 sleep(5);         } }   The problem is that the widget does not go away until the new one is created. (It is still on the screen -- unusuable -- during the "sleep" in the main prog, despite the XtDestroyWidget call).  Anyone see something I'm missing?  Thanks very much.  (Please respond via email) --  ------------------------------------------------------------------------------- David Rex Wood -- davewood@cs.colorado.edu -- University of Colorado at Boulder
I have been trying to compile some source code for a mpeg animation viewer for X Windows. I got the code from a ftp site. I have modified the Makefile as they instructed, no errors there. What happens is that I get the following message when everything is going to be linked:   	cc  util.o video.o parseblock.o motionvector.o decoders.o  fs2.o fs2fast.o fs4.o hybrid.o hybriderr.o 2x2.o  gdith.o gray.o mono.o main.o jrevdct.o 24bit.o util32.o ordered.o  ordered2.o mb_ordered.o /lib/libX11.so /lib/libXext.so -lm -o mpeg_play Undefined			first referenced  symbol  			    in file getnetpath                          /lib/libX11.so t_alloc                             /lib/libX11.so t_unbind                            /lib/libX11.so t_open                              /lib/libX11.so t_rcvdis                            /lib/libX11.so netdir_free                         /lib/libX11.so t_error                             /lib/libX11.so netdir_getbyname                    /lib/libX11.so getnetconfigent                     /lib/libX11.so t_look                              /lib/libX11.so t_errno                             /lib/libX11.so t_close                             /lib/libX11.so netdir_getbyaddr                    /lib/libX11.so t_listen                            /lib/libX11.so t_rcv                               /lib/libX11.so setnetpath                          /lib/libX11.so t_bind                              /lib/libX11.so t_connect                           /lib/libX11.so t_accept                            /lib/libX11.so nc_perror                           /lib/libX11.so inet_addr                           /lib/libX11.so ld: mpeg_play: fatal error: Symbol referencing errors. No output written to mpeg_play *** Error code 1 (bu21)  make: fatal error.  Does anyone know where these missing functions are located? If you do can you help me with it?  I posted before to one of the other Unix groups, I tried their suggestions but always get this error.  If you have to know: I am using Unix system V. The machines here are 486's. The terminals I want to use are separate and just called X-terminals and they seem dedicated to that. I'm not sure as to what they really are, since it is one of my first times out with this X-windows gidget! That is, first time programming for it, so to speak. I use them alot just for the graphics things.  If you can help, mail me soon.
Hi all,  I wrote a small application which uses pixmaps copied into a window to show some drawings. This works perfectly for all kind of objects expect large fonts. What happens on the screen is that the right half of the font is not shown. The way I create these things is quite simple; some aggregated code:  XFillRectangle(Disp, Pixs, AnyColor, 0, 0, Width, Height); XDraw[Line|Rect|String](...); XCopyArea(Disp, Pixs, Win, 0, 0, Width, Height, 0, 0);  I am using a RS6K 340 with BOS 3.2.  The question is:   is this a bug in the AIX X-server (may be some PTFs), or did I do   something wrong within my code??  Sorry for the cross-posting, but I really do not know what kind of error it is.   Juergen Schietke Research Insitute for Discrete Mathematics University of Bonn Nassestr. 2 5300 Bonn 1 (Germany)
Hey guys! I run twm and would like to execute some program before leaving twm. In other words I would like to run some program before I do f.quit. Is it possible to make a menu section which would contain these two parts?
Hi,  	Could some please tell me the errors of my ways.  	I am trying to update a drawable. This drawable  	happens to be a Pixmap on a button.  	 	The problem is that after I do the : XClearArea(XtDisplay(m_usr[0]),XtWindow(m_usr[0]), 80, 8, 40, 40, True);  	This appears to work. I then do  sprintf(tmp_str,"R=%d",++fun); XDrawString(XtDisplay(m_usr[0]), bmaps[0] ,my_gc, 78, 10, tmp_str, (strlen(tmp_str)) );  	The problem is that the new info is drawn but the old info is 	still there. Even if I pass XClearArea a False and see it clear 	when it redraws the new info, the old info is still there.   Help Please!!!         Thanks --  ------------------------------------------------------------------------      Randy Paries           rtparies@turq.b8.ingr.com x6191  cr041           Intergraph, Huntsville Alabama
Hi,  I'm working on a project that involves storing an application's rendering to an X display and then playing it back again.  Rather than  "reinvent the wheel", it like to find: 	* a file format for saving X protocol. 	* software that saves and replays such a session.  Any ideas out there?  I've heard that there is a version of Xscope that will save and replay sessions.  I'd be willing to share much of the code I develop back to the X community.   Axel............
In article <C5K6ny.AzJ@kirk.bu.oz.au>, bambi@kirk.bu.oz.au (David J. Hughes) writes: > berry@durian.citr.uq.oz.au (Andrew Berry) writes: > > Ports of Motif to both 386BSD and Linux are available for a fee of about > $100.  This is cost recovery for the person who bought the rights to > redistribute.  The activity in both the BSD and Linux news groups > pertaining to Motif has been high. >  >  > >I just wonder if this will also cause a divergence between commercial > >and non-commercial software (ie. you will only get free software using > >Athena or OpenLook widget sets, and only get commercial software using > >the Motif widget sets).   >  >  > I can't see why.  If just about every workstation will come with Motif > by default and you can buy it for under $100 for the "free" UNIX > platforms, I can't see this causing major problems.    Let me add another of my concerns: Yes, I can buy a port of Motif for "cheap", but I cannot get the source for "cheap", hence I am limited to using whatever X libraries the Motif port was compiled against (at least with older versions of Motif. I have been told that Motif 1.2 can be used with any X, but I have not seen it myself).    Currently, I have X11R5 running on eight different unix platforms, of which only three came with Motif. On those three, I am unable to use the X11R5 libraries to build Motif clients, because I get link errors between the vendor-supplied port of Motif and my X11R5. I anticipate having this same problem when X11R6 becomes available.    The result is that I cannot build Motif clients that rely on X11R5, since I do not have Motif compiled under X11R5. True, I could buy another port of Motif, but that sort of ruins the whole idea of "free", doesn't it?      Cheers,      Tom McConnell
It seems silly, but while I've located things like tgif that can  edit gif  files, and various tools to convert to/from gif format, I haven't been able to locate a program that just opens a window and displays  a gif file in it.  I've looked thru various faq files, also to no avail. Is there one lurking about in some  archive?   Nothing  sophisticated; just "show the pretty picture"?  Alternatively, if I could locate the specs for gif, I don't suppose it would be too hard to write it myself, but I have no idea where to even start looking for the spec.  (Well, actually, I do have an idea - this newsgroup.  ;-)
Dear sun and windows people,  I am running sun workstations with SunOs 4.1.1 and  vanilla X11 R5. I have a bunch of xterminals as well.  Today I had my xdm fail. At about 9:30 it was impossible to login to a host from an xterminal. The message was the "xdm too many retransmissions". In my xdm-errors file I had the following entries:     >error (pid 7423): Server for display :0 terminated unexpectedly:   >256   >error (pid 7927): WARNING: keyboard on display :0 could not be   >secured   >error (pid 7423): Server for display :0 terminated unexpectedly:   >   >I also had:   >   >error (pid 7457): WARNING: keyboard on display :0 could not be   >secured   >error (pid 7423): Server for display :0 terminated unexpectedly:   >256   >error (pid 7462): WARNING: keyboard on display :0 could not be   >secured   >error (pid 7423): Server for display :0 terminated unexpectedly:   >256  Also, at the console, the login box would come up for about 2 seconds and then it would go away. It would do this continuously.  I could login from another workstation to the hosts in question, however, I could not login on the console.  I tried killing xdm and restarting it but that didn't help. I finally rebooted all the hosts. (Which hurts when done in the middle of the day).  Any help would be appreciated.  Thanks, Phil  --  Phil Neal, Systems Programmer, Statistics Department GN-22 University of Washington, Seattle, Wa. 98195 USA  | 206-685-1627
#  # I think the original post was searching for existing implementations of # f.i. Gouroud-shading of triangles. This is fairly complex to do with plain # X. Simpler shading models are implemented already, f.i. in x3d (ask archie # where to get the latest version). # For Gouroud, a fast implementation will be possible utilizing some extension # only, either MIT-SHM to do the shade in an image and fast update the window # with it, or PEX/OpenGL which should be able to shade themselves. The portable # 'vanilla X' way would be to shade in a normal XImage and use XPutImage(), # what would be good enough to do static things as f.i. fractal landscapes # or such stuff. #  # To speak about POVRay, the X previewer that comes with the original source # package is not that good, especially in speed, protocol-friendlyness and # ICCCM compliance. Have a look on x256q, my own preview code. It is on #  # 141.76.1.11:pub/gfx/ray/misc/x256q/ #  # The README states the points where it is better than xwindow.c from # POVRay 1.0 #   The version I have is using the x256q code instead of the default X Windows code.  I have it currently running on a DEC Alpha running OpenVMS AXP and so far have been pretty impressed.  The only "side-effect" of x256q is that it requires xstdcmap -best be run before it will work, annoyning but not a show stopper.  Patrick L. Mahan  --- TGV Window Washer ------------------------------- Mahan@TGV.COM ---------
The subject does not describe the problem I am having very well.  Please read on...  I am trying to write a function which creates an XtAppContext and a Widget, displays the widget for a while, then destroys everything and returns.  The problem is that multiple calls to this function cause a variety of problems including (depending on which calls I make to get rid of things):  - Core Dump - BadPixmap X Error - Widget not unmapped   Here is a simple (C++) program I wrote to show the problem:  #include <X11/Xlib.h> #include <Xm/Xm.h> #include <Xm/PushB.h>  void bla() {         XtAppContext app;         Display *dis = XOpenDisplay("");         int junk = 0;          Widget top=XtAppInitialize (&app, "test", NULL, 0, &junk, NULL,                 NULL, NULL, 0);          Widget box = XtVaCreateManagedWidget("blaaa", xmPushButtonWidgetClass,                         top,                         XmNheight, 50,                         XmNwidth, 50,                         NULL);          XtRealizeWidget(top);         //Same as XtAppMainLoop but with only 10 XEvents         for (int i=0;i<=10;i++)         {                 XEvent event;                 XtAppNextEvent(app, &event);                 XtDispatchEvent(&event);         }  // WHAT SHOULD I PUT HERE???         XtUnrealizeWidget(top);         XtDestroyWidget(top);         XtDestroyApplicationContext(app);         XCloseDisplay(dis); // ??? }  main() {         for (int i=0;i<=20;i++)                 bla(); }  Note that I rewrote XtAppMainLoop so that at a given time (in this example, after 10 XEvents) the function will exit and return to the main program. With this example, I get the following error on about (this is NOT consistent) the 5th call to bla():  X Error of failed request:  BadPixmap (invalid Pixmap parameter)   Major opcode of failed request:  55 (X_CreateGC)   Resource id in failed request:  0xe0000d   Serial number of failed request:  71   Current serial number in output stream:  86  If I take out the XtUnrealizeWidget(top); line, it just dumps core on the seconds call.  Furthermore, every time I call XtAppInitialize() (other than the 1st time), I get:  Warning: Initializing Resource Lists twice Warning: Initializing Translation manager twice.   So finally, my question is this:  What needs to be done in order to be able to call a function which creates an XtAppContext and widgets multiple times?  Any help would be greatly appreciated.  PLEASE respond via email as I dont usually have time to read this group.  Thanks very much.  -davewood --  ------------------------------------------------------------------------------- David Rex Wood -- davewood@cs.colorado.edu -- University of Colorado at Boulder
In article <930421105641.100043a@TGV.COM>, mahan@TGV.COM (Patrick L. Mahan) writes: |>  |> # |> #Do anyone know about any shading program based on Xlib in the public domain? |> #I need an example about how to allocate correct colormaps for the program. |> # |> #Appreciate the help. |> # |>  |> I don't know if this might help, but I've just started playing with a program |> called POVRay (Persistance of Vision Raytracer) that also displays its output |> via X Windows.  It does a fairly good job of allocating the colormap on my |> Psuedo-Color 8-plane display.  I got the source from from a site in Canda. |> The person I retrieved them from was David Buck (dbuck@ccs.carleton.ca). |>   I think the original post was searching for existing implementations of f.i. Gouroud-shading of triangles. This is fairly complex to do with plain X. Simpler shading models are implemented already, f.i. in x3d (ask archie where to get the latest version). For Gouroud, a fast implementation will be possible utilizing some extension only, either MIT-SHM to do the shade in an image and fast update the window with it, or PEX/OpenGL which should be able to shade themselves. The portable 'vanilla X' way would be to shade in a normal XImage and use XPutImage(), what would be good enough to do static things as f.i. fractal landscapes or such stuff.  To speak about POVRay, the X previewer that comes with the original source package is not that good, especially in speed, protocol-friendlyness and ICCCM compliance. Have a look on x256q, my own preview code. It is on  141.76.1.11:pub/gfx/ray/misc/x256q/  The README states the points where it is better than xwindow.c from POVRay 1.0
Hi there netters,  I require a window to appear at a co-ordinates (0,0) (top left corner) of my screen (root window). Could some windows guru out there help me on how to go about doing this. I write the whole program which creates the window with the image it displays - I require the image to appear at the top-left corner so that I can grab it for recording on to video, using a MIniVas controller, which expects the window at the same spot every time.  Thanks in advance.  sincerely,  Sanjeev Sharma
jlong@b4pps40.Berkeley.EDU (John Long) writes: :    Where can I get xman source?  I would like to get the binaries for : xman for an HP 9000/700, but I would settle for source.   :  : -- Try xport.lcs.mit.edu, in direcotry /contrib. --
Hi,  I am using xdm on X11R5 with OW3 and Xview3 on Sun3s and SPARCs running  SunOS 4.1.1.  Prior to using xdm, I used to set PATH and other environment variables (like MANPATH, HELPPATH, ARCH, etc) in my .login file.  With xdm, the .login file doesn't get executed and therefore neither the olwm root-window nor my applications know about these variables.  I used the "DisplayManager._0.userPath" resource in /usr/lib/X11/xdm/xdm-config to succesfully pass the PATH variable.  But I am having problems passing anything else!!!  I tried execing $HOME/.login in /usr/lib/X11/xdm/Xsession but that didn't help.  I also tried using 	"DisplayManager.exportList: HELPPATH MANPATH ARCH" which didn't work either.  I would appreciate any help on this matter.  Thanks in advance, Shash
Im new to Xlib programming. Im having a problem I hope someone here can help me with. I create a window, and I want it to have some background color, say red, and draw an oval in it. Further, when I resize the window, I want to be able to redraw the image so that is fills the new window (whether it is larger or smaller.) Im using AIXwindows on an RS6000.  My problem is this: when I resize the window, only the "original" part of the window that was part of the window creation gets drawn into. Everything else is a grey..the oval "tries" to redraw itself but gets clipped. I can see that it WOULD be the right size if I could see all of it, but it only shows up in the region that was the original size of the window when created.  For example, I start out the window at 200x200 in width and height. If I resize it to 400x400, the only part that has any color drawn into it is is from the origin out to 200x200..the rest is grey. Further the oval only shows up in that 200x200 area.  What am I doing wrong?? How can I get a window to resize and redraw a  re-scaled image in it to take up the full size of the window?  Second question: Could someone tell me what Xaw and Xmu are???
Dear Netters:     Could you mail the source code of the book:     "Advanced X window application programming" by Johnson and Reichard      TO ME?      If you need any source code, just ask me.      Thank you very much!                                       Sincerely,                                      Zeng, Qiyong.
>I think you may find that either Quarterdeck (Deskview/X) or >Hummingbird (eXceed) provide an Xlib for DOS.  Perhaps they also have >an Xlib for MS-Windows?  It's a possibility. >  Yes, eXceed has windows version. Have ported some games like tetris,  works fine.  Si c'est vrai, ce serait bien de se le procurer car a ce moment la, le portage Xt... Suis-je en train de perdre mon temps avec la toolkit c++ ?
In article <1r28mg$9r5@fitz.TC.Cornell.EDU> matthew@alchemy.TN.Cornell.EDU (Matthew Kleinmann) writes:  |  I have a Sun 3/60 that has a mono framebuffer (bwtwo0 ?) built on the |  motherboard.  The same system also has a cgfour (cgfour0 and bwtwo1 ?) |  daughterboard.  I have been using this system with a color monitor having a |  color "front" screen from the cgfour, and a mono "back" screen from the |  bwtwo1, both on the same tube.  I recentley picked up a 1600 x 1280 Sun mono |  monitor, and I would like to make a two headed system with the cgfour0 and |  the bwtwo0.  I do not care if I loose the "back" screen on the color tube |  from the bwtwo1.  After looking through the Xsun man page I am not sure if |  this is possible.  Has anybody sucessfuly done this before?  If it's any consolation, I have two 2-headed Sun-3/60 systems, though the color and mono monitors for each are "rated" 1152x900.   Their configuration is the same as yours, so it "should" be a Plug'N'Play situation, EXCEPT:  I don't know if your hi-res mono monitor will function this way.  However, you may simply be able to pull the motherboard and set the HI-RES jumper (located in the same jumper array as the jumpers for the RAM/SIMM selects and Ethernet connection) and be happily on your way.  When you pull the motherboard, the jumpers are in the left-rear (e.g. "north-west") quadrant of the motherboard (to the left of the SIMM sockets).
In article <1r3fe2INN10d@fbi-news.Informatik.Uni-Dortmund.DE> markhof@ls12r.informatik.uni-dortmund.de (Ingolf Markhof) writes: [...] |> I have an |>  |> 	alias precmd echo -n '^[]2\;${HOST}:$cwd^G' |>  |> in my ~/.tcshrc. This is a special alias for tvtwm.   I presume that you meant to say tcsh here ------^^^^^  --   Michael Salmon  #include	<standard.disclaimer> #include	<witty.saying> #include	<fancy.pseudo.graphics>
In article <1993Apr19.191531.15865@news.media.mit.edu>, dyoung@media.mit.edu (David Young) writes:    :   :  |>    XSetFunction( myDisplay, gc, GXxor); |>    XSetForeground( myDisplay, gc, drawIndex); |>  |> Then to draw I do: |>  |>    XDrawLine( myDisplay, XtWindow( drawingArea1), gc, x1, y1, x2, y2); |>    XFlush( myDisplay); |>  |> And when I'm all done, to return things to normal I do: |>  |>    XSetFunction( myDisplay, gc, GXcopy); |>  |>  |> What I'd like to happen is for the lines I draw to be the inverse of |> whatever I'm drawing over.  Instead what happens is I get white lines.  If |> the lines are over a white background - nothing shows up.  If the lines are |> over a black area - nothing shows up!  It's very strange.  But the GXxor |> function seems right - since if I do a rubber-banding box, it erases and |> redraws itself correctly (ie. not disturbing the underlying image). |>  |> Any suggestions what I'm doing wrong? |>  |> david      Try change the GXxor to GXequiv.  I have to do this for programs that    are to run on NCD terminals (on Sun terminals I have to change it    back to GXxor)...