Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Locate palette at top edge of screen?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg91332] Locate palette at top edge of screen?
  • From: "L. Dwynn Lafleur" <lafleur at louisiana.edu>
  • Date: Sat, 16 Aug 2008 05:53:28 -0400 (EDT)

(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
=====================================


  • Prev by Date: Re: No Memory Available
  • Next by Date: Player Pro Usage
  • Previous by thread: Re: plotting plane & a triangle
  • Next by thread: Re: Locate palette at top edge of screen?