[vwnc] Implementing ModelWindow

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

[vwnc] Implementing ModelWindow

Kiran S Pillai-2
Hello,
 
I have some problems for implementing the model window concept (parent-child) in my application which works in LINUX environment.

I have used the code fragment
 
WindowManager changeWindowEffectiveTypeFor: builder window
  to: #imageModalDialog.
 
This works fine in the Windows OS, But not in Linux.
 
So I have tried to implement the methods used by the "ClassFinder" in Smalltalk.
 
openDialogInterface: aSymbol
 
 dialog := SimpleDialog new.
 builder := dialog builder.
 dialog postOpenBlock: [:dlg :bld |
  self postOpenWith: bld].
 dialog openFor: self interface: aSymbol.
 
But then also I have some problems in my application. This code fragment opens my application window like a dialog window. But I have to execute some functions just after opening the window. But it seems that only after getting a close notification from the user these functions are going to execute.
 
Is this the correct way or is there any mistake?
 
I have also tried with the concepts " becomeActive and becomeInactive".But in vain.
 
Can anybody please provide me a suitable solution?
 
Thanks & Regards
Kiran S Pillai

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] Implementing ModelWindow

skrish
I guess the common advice to all of these kind of queries has been:

Read the pdf guide book in the {installation}/doc  folder thoroughly... every page of every pdf relevant.

Read GUIDevGuide.pdf pg72 if it is relevant to your attempt.

| masterWin slaveWin |
masterWin := ( Editor1Example new ) openInterface; mainWindo
masterWin 
label: 'Master';
application: app;
beMaster.
slaveWin := (Editor2Example new) open; mainWindow.
slaveWin 
label: 'Slave';
application: app;
beSlave.

regards
skrish

On Fri, Feb 20, 2009 at 10:08 AM, Kiran S Pillai <[hidden email]> wrote:
Hello,
 
I have some problems for implementing the model window concept (parent-child) in my application which works in LINUX environment.

I have used the code fragment
 
WindowManager changeWindowEffectiveTypeFor: builder window
  to: #imageModalDialog.
 
This works fine in the Windows OS, But not in Linux.
 
So I have tried to implement the methods used by the "ClassFinder" in Smalltalk.
 
openDialogInterface: aSymbol
 
 dialog := SimpleDialog new.
 builder := dialog builder.
 dialog postOpenBlock: [:dlg :bld |
  self postOpenWith: bld].
 dialog openFor: self interface: aSymbol.
 
But then also I have some problems in my application. This code fragment opens my application window like a dialog window. But I have to execute some functions just after opening the window. But it seems that only after getting a close notification from the user these functions are going to execute.
 
Is this the correct way or is there any mistake?
 
I have also tried with the concepts " becomeActive and becomeInactive".But in vain.
 
Can anybody please provide me a suitable solution?
 
Thanks & Regards
Kiran S Pillai

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] Implementing ModelWindow

Steven Kelly
In reply to this post by Kiran S Pillai-2
Skrish already answered how to do master-slave windows, but maybe you just mean you want a modal dialog? There are some important differences:
 
 - With a master-slave relationship, the slave window is closed or minimized automatically when the parent window is closed or minimized. Both windows can be resized, and when both are open, you can still click in either window or any other window in your application to focus there. The code that opens the slave window will continue immediately, with both windows remaining open.
 
 - With a modal dialog open, you can only work in that dialog: clicking in any other window does nothing. Modal dialogs cannot be resized normally in Windows, but can in some windowing systems on Unix. The code that opens the modal dialog will block on the open call until the modal dialog has been closed.
 
If you want a modal dialog, don't use #changeWindowEffectiveTypeFor:to:, but rather just the #openDialogInterface: code you showed. Your openDialogInterface: code looks good to me. The functions you want to execute right after the window has opened should be placed in #postOpenWith: (if your window also implements #postBuildWith:, you can set #postBuildBlock: similarly). The next line of code after #openFor:interface: will not be executed until the dialog has been closed.
 
Hope this helps,
Steve
 


From: [hidden email] on behalf of Kiran S Pillai
Sent: Fri 2/20/2009 06:38
To: [hidden email]
Subject: [vwnc] Implementing ModelWindow

Hello,
 
I have some problems for implementing the model window concept (parent-child) in my application which works in LINUX environment.

I have used the code fragment
 
WindowManager changeWindowEffectiveTypeFor: builder window
  to: #imageModalDialog.
 
This works fine in the Windows OS, But not in Linux.
 
So I have tried to implement the methods used by the "ClassFinder" in Smalltalk.
 
openDialogInterface: aSymbol
 
 dialog := SimpleDialog new.
 builder := dialog builder.
 dialog postOpenBlock: [:dlg :bld |
  self postOpenWith: bld].
 dialog openFor: self interface: aSymbol.
 
But then also I have some problems in my application. This code fragment opens my application window like a dialog window. But I have to execute some functions just after opening the window. But it seems that only after getting a close notification from the user these functions are going to execute.
 
Is this the correct way or is there any mistake?
 
I have also tried with the concepts " becomeActive and becomeInactive".But in vain.
 
Can anybody please provide me a suitable solution?
 
Thanks & Regards
Kiran S Pillai

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc