On 22 Oct 2003 15:53:14 +0200, Tomas ?kesson wrote:
>
> When my module (FvwmSaveWindow) is called from a menu or button (by the
> use of SendToModule), I do this in my module-code:
> $module->send("Send_WindowList");
>
> This causes an event-handler being called:
> $module->addHandler(M_WINDOW_NAME, sub {
> my ($module, $event) = _at__;
> ...
> });
>
> My problem is that I would like to know some data (mainly position and
> size) about the window which was selected when the
> "Send_WindowList"-command was issued. I can't seem to find a reasonable
> way to get this in the handler.
I think you do this correctly. The window size/position is passed using
M_ADD_WINDOW or M_CONFIGURE_WINDOW events, not M_WINDOW_NAME.
Continue with this, it's the only way. Another way will be using
WindowList tracker (but not very soon) that will hide all this black work
from you.
> I could maybe call the module with the window-id explicitly in the config:
> SendToModule FvwmSaveWindow $winId "save"
> (or however it would look like?) but I would rather do it in the
> module-code.
I am not sure what is your problem, you already get the window context of
SendToModule command in your code (M_STRING event).
If your module would be transient (not your case) you could run it from a
window context rather than from StartFunction. In this case the window
context of your module may be found in $module->{winId}.
Regards,
Mikhael.
--
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 Wed Oct 22 2003 - 13:51:32 BST