gettingstarted
[Top] [All Lists]

Re: Mysterious Window Appearance

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: Mysterious Window Appearance
From: Terry Ford <tmford at shaw dot ca>
Date: Sat, 29 May 2004 10:36:44 -0700
Delivered-to: gettingstarted at lists dot realsoftware dot com
List-help: <mailto:gettingstarted-request@lists.realsoftware.com?subject=help>
List-id: Getting Started <gettingstarted.lists.realsoftware.com>
List-post: <mailto:gettingstarted@lists.realsoftware.com>
References: <1da dot 22d5ea21 dot 2dea0d09 at aol dot com> <C3E51B8B-B18A-11D8-B45A-000A959DF1D2 at realsoftware dot com>

On 29-May-04, at 9:10 AM, Jonathan Johnson wrote:


On May 29, 2004, at 10:58 AM, GAmoore at aol dot com wrote:
Thanks Jon.
I have that timer set to mode 1 to begin with, so it fires a single time
whent he splash
screen opens. When that timer fires, it causes the window to close. After
that,   I wanted
to set the mode to 0, so that if the user calls "About this application", it
opens indefinitely
(and the timer is not activated). If I reverse the order, then the timer will
be turned off
to begin with.

Ah, I misunderstood what the code was attempting to do. I assumed that it was meant to show the window and change the timer while it's opened (to prevent an auto-close). To do what you want to do, you would need to "hide" the window instead of closing it. The code would read:

winSplash.ShowModal
winSplash.Timer1.Mode = 0

and then in the timer's action event:
Hide

There was an old slogan, "Ford has a better idea", but I think the Ford Motor Company has a copyright on that one. :-)

Anyway, here goes my suggestion.

In your combination Splash-About window, create a method named "init" with the parameters "i As Integer". In that put the following code:

Sub init(i As Integer)
   //Splash or About
   If i=0 Then
      Timer1.mode=1
   End If
   ShowModal
End Sub

The Splash-About window's Timer1 Action Event code is simply 'Close'

In your App Open event, add the following code:

Splash-About.init(0)

This will instantiate the window and set the timer to close after the period set.

In your App MenuHandler, for the About MenuItem, put the following code:

Splash-About.init(1)

This will instantiate the window and bypass the timer.

Now comes the $64,000 question; how to close the About window. Since splash windows are going out of style in most OSX apps, they have close buttons to close them. But, you don't want one in your combo Splash-About window so you have to do one more thing. Place a Canvas control on top of the entire window and put the following code in the MouseDown event of the Canvas:

Function MouseDown(X As Integer, Y As Integer) As Boolean
   close
End Function

Since a lot of people like to disable the splash screen, it's a good idea to include that in the preferences for your application. But that's a whole other topic.

HTH,



Terry Ford

_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>