|
From: Ben A. <ben...@tq...> - 2009-01-29 20:49:03
|
On Dec 29, 2008, at 12:15 AM, Ethan A Merritt wrote: > On Sunday 28 December 2008, Ben Abbott wrote: >> >> On Dec 28, 2008, at 9:10 PM, Ethan A Merritt wrote: >> >>> On Sunday 28 December 2008, Ben Abbott wrote: >>> >> >>>> *SNIP* >>>> By the way, it would really be cool if there was a method by which >>>> the >>>> size and position of a plot window could be determined. That way >>>> if a >>>> user moves or resizes a window Octave could do some checking and >>>> have >>>> some awareness of such (I'd be stunned if such were possible, but >>>> thought I'd ask). >>> >>> You can do that with a call into xlib; you don't need any special >>> code in gnuplot for that. You should be able to get all the info >>> you'd get from the command line using "xwininfo" >> >> hmmm ... that may be quite useful. >> >> xwininfo: Window id: 0xc00008 "Figure 1" >> >> Absolute upper-left X: 440 >> Absolute upper-left Y: 128 >> Relative upper-left X: 0 >> Relative upper-left Y: 22 >> Width: 560 >> Height: 493 >> Depth: 24 >> Visual Class: TrueColor >> Border width: 0 >> Class: InputOutput >> Colormap: 0x21 (installed) >> Bit Gravity State: ForgetGravity >> Window Gravity State: NorthWestGravity >> Backing Store State: NotUseful >> Save Under State: no >> Map State: IsViewable >> Override Redirect State: no >> Corners: +440+128 -440+128 -440-279 +440-279 >> -geometry 560x493+440+106 >> >> Unfortunately, the height includes the portion needed to display the >> cursor's coordinates ... sigh :-( > > That extra height is equal to term->v_char. This quantity is not > currently exported as a user variable, but it would be trivial to do > so. > Do you want it? Its name would be GPVAL_TERM_VCHAR. I'm back hoping to better understand what is needed to determine the position of a specific gnuplot x11 window. I can see how xwininfo can be used, but how do I determine the window id (0xc00008 in the instance above)? Would it be necessary to patch gnuplot? Regarding the proposed GPVAL_TERM_VCHAR, how would be be accessed? Ben |