Login  Register

Re: Width of Log window

Posted by Douglas Benn-2 on Mar 11, 2010; 9:59pm
URL: http://imagej.273.s1.nabble.com/Width-of-Log-window-tp3689009p3689014.html

Dear Michael,

Thanks very much. I feared as much.

Best wishes.

Douglas

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
Michael Schmid
Sent: Thursday, March 11, 2010 3:07 PM
To: [hidden email]
Subject: Re: Width of Log window

Hi Douglas,

hmmm, I see, I should also read the documentation more carefully...

setLocation(x, y, width, height)
Moves and resizes the active *image* window.

Funny enough, this is different from setLocation(x, y), which also  
works with non-image windows. The code in ij.macro.Functions.java  
shows this difference quite clearly.
I fear that this cannot be changed without some risk of breaking  
existing macros that rely on the macro call working on the current  
image window and not on, e.g., a Results window that might be open  
and in front of the image window.

So it seems that you can't resize the Log window in a macro.

Michael
________________________________________________________________

On 11 Mar 2010, at 19:47, Douglas Benn wrote:

> Hi Michael,
>
> Thank you for your reply.
>
> Yes I am very familiar with the macro functions which I have been  
> using. In
> fact I wrote the following code
>
> print("Open Log window");
> selectWindow("Log");
> setLocation(100,100,800,700);
> updateDisplay();
> print(".....................................");
>
> The output into the Log was
>
> Open Log window
> .....................................
>
>
> But the size of the window does not increase from the default  
> value. Any
> suggestions?
>
> Thanks.
>
> Douglas
>
>
> On 3/11/10 12:11 PM, "Michael Schmid" <[hidden email]> wrote:
>
>> Hi Douglas,
>>
>> first you should say whether you write a macro or a plugin.
>>
>> For macros, see
>>    http://rsb.info.nih.gov/ij/developer/macro/functions.html
>>
>> There, you will discover the selectWindow("name") and setLocation(x,
>> y, width, height) commands.
>>
>> For a plugin, java.awt.Window is a subclass of java.awt.Component.
>> It inherits the setSize(int width, int height) method.
>> See
>>    http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Window.html
>>
>> Michael
>> ________________________________________________________________
>>
>> On 11 Mar 2010, at 18:40, Benn, Douglas K. wrote:
>>
>>> Can anybody please tell me the correct syntax for setting the  
>>> width of
>>> the Log window?
>>>
>>>
>>> Thank you.
>>>
>>> Douglas Benn
>
> Dr Douglas K Benn, BDS, M.Phil., Ph.D., Dipl. Dental Radiology (Royal
> College of Radiologists, England).
> Professor
> Dept of General Dentistry
> Creighton University Dental School
> 2500 California Plaza
> Omaha
> Nebraska 68178
>
> Tel: (402)280 5025
> Fax: (402)280 5094