Showing a ShellView maximized

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Showing a ShellView maximized

Mikael Svane
I am trying to open a ShellView maximized by adding the following
#onViewOpened method to my presenter:

onViewOpened
    super onViewOpened.
    self view showMaximized

This works partially, since the view is maximized for a very short while,
before Presenter>>show sends #show to the view. This results in that
View>>showWithStyle: is evaluated, which immediately makes the view smaller
again. The image contains no references to ShellView>>showMaximized so I
can't figure out when to execute this method. Is there an event that occurs
after #viewOpened where I can send #showMaximized or do I have to create my
own ShellView subclass that modifies #defaultShowStyle (and in that case,
what is the value for maximized style)?

Best regards,
Mikael Svane


Reply | Threaded
Open this post in threaded view
|

Re: Showing a ShellView maximized

Andy Bower-3
Mikael,

> I am trying to open a ShellView maximized by adding the following
> #onViewOpened method to my presenter:
>
> onViewOpened
>     super onViewOpened.
>     self view showMaximized
>
> This works partially, since the view is maximized for a very short
> while, before Presenter>>show sends #show to the view. This results
> in that View>>showWithStyle: is evaluated, which immediately makes
> the view smaller again. The image contains no references to
> ShellView>>showMaximized so I can't figure out when to execute this
> method. Is there an event that occurs after #viewOpened where I can
> send #showMaximized or do I have to create my own ShellView subclass
> that modifies #defaultShowStyle (and in that case, what is the value
> for maximized style)?

You could use:

onViewOpened
   super onViewOpened.
   [self view showMaximized] postToInputQueue


This will defer the execution of the maximize until the Windows message
queue is again allowed to pump messages (i.e. after the current Windows
message has completed and the view has been created).

Best regards


Andy Bower
Dolphin Support
www.object-arts.com


Reply | Threaded
Open this post in threaded view
|

Re: Showing a ShellView maximized

John Aspinall-5
In reply to this post by Mikael Svane
Mikael,

> I am trying to open a ShellView maximized by adding the following
> #onViewOpened method to my presenter:

There may be a better way, but the following works: override showShell in your
Shell subclass:

showShell

    self view showMaximized


Best regards,

John Aspinall
Solutions Software
http://www.solutionsoft.co.uk