Re: Locate palette at top edge of screen?
- To: mathgroup at smc.vnet.net
- Subject: [mg91363] Re: Locate palette at top edge of screen?
- From: "L. Dwynn Lafleur" <lafleur at louisiana.edu>
- Date: Mon, 18 Aug 2008 03:37:14 -0400 (EDT)
- References: <g8682n$hpr$1@smc.vnet.net> <g88v7m$gur$1@smc.vnet.net>
Jens,
Thanks for the reply. However, using the slider created with your
command cannot move the palette ABOVE the bottom of the main title bar,
at least not on my system. After executing the commands written in your
message, when I drag the created slider upward with my mouse, the
palette faithfully tracks the slider position until the top edge of the
palette reaches the bottom edge of the main title bar. Thereafter, as I
continue to drag the slider upward, the palette does not respond.
Increasing the vertical coordinates of the initial position and/or that
of the maximum slider position the numerical parameters in the
Manipulate command still does not allow the palette to be position above
the bottom edge of the main title bar. So far, the only way I have
found to get the palette above the bottom edge of the title bar is to
drag it manually with the mouse.
Dwynn
Jens-Peer Kuska wrote:
> Hi,
>
> try
>
> pal = CreatePalette[PasteButton[\[Alpha]]];
>
> Manipulate[
> SetOptions[pal,
> WindowMargins -> {{p[[1]], Automatic}, {p[[2]], Automatic}}]; p,
> {{p, {0, 0}}, {0, 0}, {1280, 1024}, ControlType -> Slider2D}
> ]
>
> and use the position you like.
>
> Regards
> Jens
>
> L. Dwynn Lafleur wrote:
>> (Windows XP SP3, Mathematica 6.0.3)
>>
>> I am trying to create a command that moves a palette so that its top
>> edge is at or near the top edge of the screen, i.e., superimposed on the
>> space occupied by the main title bar (the bar containing "Wolfram
>> Mathematica 6.0 - <notebook name>" and the menu titles.)
>>
>> If I simply use the example in the "CreatePalette" entry in the Help
>> documentation
>>
>> pal = CreatePalette[PasteButton[\[Alpha]]];
>>
>> a small palette is created. (In my case, most of it extends off the
>> right edge of my screen).
>>
>> I then use the mouse to drag this palette onto the center area of the
>> main title bar, placing its top edge at the top edge of the screen and
>> thus practically coincident with the top edge of the main title bar.
>> To determine the coordinates (window margins) in this desired location,
>> I execute the command
>>
>> Options[pal, WindowMargins]
>>
>> and the result in this case is
>>
>> {WindowMargins -> {{599, Automatic}, {Automatic, -50}}}
>>
>> Using the mouse, I drag the palette away from this location, then
>> execute the following command, expecting it to move the palette back to
>> the desired position.
>>
>> SetOptions[pal, WindowMargins -> {{599, Automatic}, {Automatic, -50}}
>>
>> Instead, the palette moves to the correct horizontal postion, but its
>> top edge is at the BOTTOM edge of the main title bar, not at the top
>> edge of the screen. Executing the command
>>
>> Options[pal, WindowMargins]
>>
>> yields
>>
>> {WindowMargins -> {{599, Automatic}, {Automatic, -50}}}
>>
>> which is inconsistent with the screen position. Indeed, if I again move
>> the mouse to another location, then execute
>>
>> SetOptions[pal, WindowMargins -> {{599, Automatic}, {Automatic, 0}}
>>
>> the palette moves back to its previous position right below the main
>> title bar. Thus an upper margin of 0 corresponds with the bottom edge
>> of the main title bar, therefore implying a value of -50 should be above
>> that edge. However, it seems a command of the form
>> "SetOptions[...,WindowMargins->{{...},{Automatic,x}}]" converts negative
>> values of x to 0.
>>
>> Is there a command that can move a palette so its top edge is at the top
>> edge of the screen?
>>
>>
>> Dwynn
>>
>
--
=====================================
L. Dwynn Lafleur
Professor of Physics
University of Louisiana at Lafayette
lafleur at louisiana.edu
=====================================