How To Remove Maximize/Minimize Button from Window Manager on My Main Window - Xwindows

This is a discussion on How To Remove Maximize/Minimize Button from Window Manager on My Main Window - Xwindows ; I need to disallow the user from resizing my main window using the Maximize/Minimize button in the window manager's title bar. Is there any way for me to tell the window manager via a hint or something to not display ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: How To Remove Maximize/Minimize Button from Window Manager on My Main Window

  1. How To Remove Maximize/Minimize Button from Window Manager on My Main Window

    I need to disallow the user from resizing my main window using the
    Maximize/Minimize button in the window manager's title bar. Is there
    any way for me to tell the window manager via a hint or something to
    not display this capability in the title bar? Or, at least for my
    program to handle ignoring it via a callback?

    Thank you for your help !
    Julie


  2. Re: How To Remove Maximize/Minimize Button from Window Manager on My Main Window

    I am answering my own post with a solution for mwm, in case it helps
    someone else! (My window manager is not mwm so I need to keep looking
    for a solution):

    Here are directions from an EXCELLENT post on how to remove the
    MAXIMIZE and MINIMIZE butttons from an mwm titlebar:

    Configuring the Window Manager Decorations
    -----------------------------------------------------------------
    Firstly, the window manager decorations are controlled through the
    XmNmwmDecorations resource of the shell. This is a mask formed by
    combining
    the following values:

    #include

    MWM_DECOR_ALL
    MWM_DECOR_BORDER
    MWM_DECOR_MINIMIZE
    MWM_DECOR_MAXIMIZE
    MWM_DECOR_TITLE
    MWM_DECOR_MENU
    MWM_DECOR_RESIZEH

    For example, to remove the maximize and minimize buttons, the following
    code
    will do the trick:

    extern Widget shell;

    XtVaSetValues (shell,
    XmNmwmDecorations,
    MWM_DECOR_ALL | MWM_DECOR_MAXIMIZE | MWM_DECOR_MINIMIZE,
    NULL);

    Configuring the Window Manager Menu
    --------------------------------------------------------
    Secondly, the contents of the menu is controlled through the
    XmNmwmFunctions
    resource of the shell. This is also a mask, formed from the following
    values:

    #include

    MWM_FUNC_ALL
    MWM_FUNC_RESIZE
    MWM_FUNC_MOVE
    MWM_FUNC_MINIMIZE
    MWM_FUNC_MAXIMIZE
    MWM_FUNC_CLOSE

    For example, the following code removes the Close option from the menu:

    extern Widget shell;

    XtVaSetValues (shell,
    XmNmwmFunctions,
    MWM_FUNC_ALL | MWM_FUNC_CLOSE,
    NULL);

    Note that in the specified question requirements, you probably also
    want to
    remove the menu maximize/minimize options for consistency, otherwise
    the
    user can still maximize/minimize the application using the menu
    options,
    even though you have removed the window manager decoration buttons. The
    following code also removes the maximize, minimize menu entries:

    extern Widget shell;

    XtVaSetValues (shell,
    XmNmwmFunctions,
    MWM_FUNC_ALL | MWM_FUNC_CLOSE |
    MWM_FUNC_MAXIMIZE | MWM_FUNC_MINIMIZE,
    NULL);

    julie wrote:
    > I need to disallow the user from resizing my main window using the
    > Maximize/Minimize button in the window manager's title bar. Is there
    > any way for me to tell the window manager via a hint or something to
    > not display this capability in the title bar? Or, at least for my
    > program to handle ignoring it via a callback?
    >
    > Thank you for your help !
    > Julie



  3. Re: How To Remove Maximize/Minimize Button from Window Manager on My Main Window


    "julie" wrote in message
    news:1164895366.675295.271460@80g2000cwy.googlegro ups.com...
    >I need to disallow the user from resizing my main window using the
    > Maximize/Minimize button in the window manager's title bar. Is there
    > any way for me to tell the window manager via a hint or something to
    > not display this capability in the title bar? Or, at least for my
    > program to handle ignoring it via a callback?
    >
    > Thank you for your help !
    > Julie
    >


    If you are using Xt or Motif, look at resource XtNmwmDecorations on the
    shell widget.
    --
    Fred L. Kleinschmidt
    Boeing Associate Technical Fellow
    Technical Architect, Software Reuse Project



  4. Re: How To Remove Maximize/Minimize Button from Window Manager on My Main Window

    On 30 Nov 2006 08:44:26 -0800, "julie" wrote:

    >I am answering my own post with a solution for mwm, in case it helps
    >someone else! (My window manager is not mwm so I need to keep looking
    >for a solution):
    >

    Some non-Motif WMs do honor the Motif hints. KDE3 does (though not
    KDE2). Which WM are you using?


+ Reply to Thread