Re: FVWM: Drag to create an xterm

From: Tavis Ormandy <taviso_at_sdf.lonestar.org>
Date: Thu, 31 Mar 2005 14:49:07 +0100

On Thu, Mar 31, 2005 at 02:02:10PM +0200, Uwe Pross wrote:
> Hi there,
>
> recently I saw a demonstration of plan 9 where the
> presenter clicked on the root window and dragged a
> rectangle to start a terminal with position and size of the
> drag gesture. I think this is a really nice way to start
> and place xterms or other apps.
>
> I am thinking of writing a fvwm function to achieve this
> and stuck currently at following points.
> - A grid should be drawn while dragging.
> - Xterm (or another app) should be started on key release.
>
> Any suggestions how to achieve the desired behaviour?
>

Wow, that's a really cool idea!

The fist part is no problem, it's easy to start an xterm when drawing a
rectangle and identifying the pointer position when you started, but I'm
not sure how you could find the length and width of the rectangle.

Something like this should start an xterm at the stroke start position when
you draw a rectangle on the root window:

AddToFunc StrokeFuncWrapper
+ I SetEnv StrokeStart +$[pointer.x]+$[pointer.y]
+ I StrokeFunc DrawMotion FeedBack StrokeWidth 2 EchoSequence

AddToFunc StartStrokeXterm I Exec exec xterm -g $[StrokeStart]

Mouse 3 R A StrokeFuncWrapper
Stroke N741236987 0 R N StartStrokeXterm

I can't think of anyway to identify the geometry of the drawn rectangle,
my first thought was to capture the output of EchoSequence, but
unfortunately that isn't much use.

-- 
-------------------------------------
taviso_at_sdf.lonestar.org | finger me for my gpg key.
-------------------------------------------------------
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Thu Mar 31 2005 - 07:50:11 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:57 BST