Novice question - child window in VW5i.2 
Author Message
 Novice question - child window in VW5i.2

Hi,

I'm writing a Smalltalk game as a semestral assignment (in VW5i.2-NC).
I can't manage doing rather a simple thing (I suppose). In a method
Game>>initialize I want to open a child window (specification of
which is Game>>prefsWindowSpec) in such a way, that method's code
execution stops until the child window is closed.
Could someone please help with this problem. Unfortunately I'm new
to Smalltalk, so I'd appreciate a response even a novice like me would
understand.
As for now, I'm yet pretty confused with specifications, builders,
canvas, etc.
Thanks for any help,

Mike Siwak



Mon, 23 Jun 2003 04:40:35 GMT  
 Novice question - child window in VW5i.2
You want a dialog.  Simplest form is:

Dialog warn: 'Press OK to Continue'

For more complex dialogs the simplest thing to do is subclass your custom
dialog off of SimpleDialog.

Its hard to gather everything from your posting.  But it seems to me that
you may need to create more objects (classes) while doing this.
For example GamePreferenceApp may be a good choice.  And maybe
GameMainApp.  I would highly recommend not using Game as part of the class
name.  If you where creating Quake it would be more like QuakeMainApp and
QuakePreferencesApp

Hope this helps

Chris Lopeman
Object Link Inc.

Quote:

> Hi,

> I'm writing a Smalltalk game as a semestral assignment (in VW5i.2-NC).
> I can't manage doing rather a simple thing (I suppose). In a method
> Game>>initialize I want to open a child window (specification of
> which is Game>>prefsWindowSpec) in such a way, that method's code
> execution stops until the child window is closed.
> Could someone please help with this problem. Unfortunately I'm new
> to Smalltalk, so I'd appreciate a response even a novice like me would
> understand.
> As for now, I'm yet pretty confused with specifications, builders,
> canvas, etc.
> Thanks for any help,

> Mike Siwak



Mon, 23 Jun 2003 05:00:12 GMT  
 Novice question - child window in VW5i.2

Quote:
> You want a dialog.  Simplest form is:

> Dialog warn: 'Press OK to Continue'

> For more complex dialogs the simplest thing to do is subclass your custom
> dialog off of SimpleDialog.

> Its hard to gather everything from your posting.  But it seems to me that
> you may need to create more objects (classes) while doing this.
> For example GamePreferenceApp may be a good choice.  And maybe
> GameMainApp.  I would highly recommend not using Game as part of the class
> name.  If you where creating Quake it would be more like QuakeMainApp and
> QuakePreferencesApp

> Hope this helps

> Chris Lopeman
> Object Link Inc.

First, thanks for answering so quickly. Now, I think that Dialog class is
rather too simple for what I want to do, because the window is supposed
to hold about two dozens of parameters with labels and input fields in
it.

I took Your advice and created a distinct class for Preferences Window.
It has it's window specification #windowSpec created in UIPainter. I open

it by sending openPrefsWindow to MainGameWindow. The window is
being closed by clicking on a button with action closeRequest associated
with it.

And it all works almost as I wanted it to. There's only one problem --
the class PrefsWindow inherits from UI.ApplicationModel (is this good?)
and so when the window opens it's modal (I hope I got the name right ;-
)), I mean I can freely switch between main and preferences windows.
How should I change it?
Thanks for Your time,

Mike Siwak



Wed, 25 Jun 2003 20:26:06 GMT  
 Novice question - child window in VW5i.2

Quote:

>And it all works almost as I wanted it to. There's only one problem --
>the class PrefsWindow inherits from UI.ApplicationModel (is this good?)
>and so when the window opens it's modal (I hope I got the name right ;-
>)), I mean I can freely switch between main and preferences windows.
>How should I change it?

Make it a subclass of SimpleDialog.  Also, you don't need to write any
methods in your class to make OK and Cancel button work, just set their
action properties to #accept and #cancel.

--Vassili

--
Vassili Bykov



Thu, 26 Jun 2003 04:40:49 GMT  
 Novice question - child window in VW5i.2
I haven't worked with GUI for a while, but I remember being dissatisfied
with the fact that the class hierarchy splits between modal and non-modal.
We found that some behaviors were found on only the non-modal side that
could be applied to either.  I wonder if something similar to role or policy
classes might be needed.


Sat, 28 Jun 2003 02:02:56 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Novice child package question

2. vw5i.1 -> vw5i.3

3. Novice RETRACT question (now SETOF/BAGOF question)

4. Second window as child within first window

5. Stop main window from closing app when child windows exist

6. Making the Tk toplevel window a child windows of my Win32 app

7. Internalization in VW5i.4nc for Windows ME

8. NEWBIE question about calling WinAPI function in VW5i.3

9. VW5i UNIX VM question

10. vw5i-oracle: modified question

11. A VW5i question

12. Pear on Windows 98 - Novice problems

 

 
Powered by phpBB® Forum Software