March 29, 2024, 05:37:54 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Switching between windows or from main to child window

Started by AdrianFox, January 02, 2014, 11:10:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

AdrianFox

Just trying to do a little program after more than a year of doing no programming in IWBasic at all,  and of course I find my grey matter has atrophied and I've forgotten some of the most basic things! 

Worse, after a major disaster with my Desktop and lack of backups I've lost a lot of my old code I used to refer to, to help me at such times!

I'm trying to do something very simple which is switch via a button or menu item from the main window to a child window.  I thought I would save a whole lot of time by using IWB+ in setting up the windows.

I've set up my two windows in IWB+ with Main as the main window, and Dialog2 as the child.  Both are defined in Globals.iwb of course, and the global sub is declared as it should be in the inc file,  'Declare Extern Init_Dialog2()  '

Should  calling the global sub Init_Dialog2() from my button response code  be sufficient to make the second window appear?  Clearly lot as all I get when I compile is the main window portrayed and no change. 

What other basic code should I be using to make the child window appear?  I have tried hiding and showing the various windows but that is clearly not the problem.

A quick shove in the right direction would probably get me 'rebooted' into some kind of programming mode,  so I would be grateful if you could help.

I will of course post the code if necessary, but it mostly just what is generated by IWB+ in creating a main window and a child window or dialog.

Adrian Fox

LarryMc

in your main window 'button response code"(as you called it) you need to open the dialog with a  DOMODAL or SHOWDIALOG command
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

AdrianFox

Thanks Larry!  That's all it took to get my brain back into gear!  Happy New Year.
Adrian Fox