BBC BASIC for Windows
General >> General Board >> How to spawn 1-3 child windows for graphics
http://bb4w.conforums.com/index.cgi?board=general&action=display&num=1251955515

How to spawn 1-3 child windows for graphics
Post by 19Grumpah42 on Sep 3rd, 2009, 05:25am

Hello BBC World Service! grin
I could use some help with Win SYS API calls. I have pop-ups and file-opens working fine, now I need to open (and draw to) a series of child (?) windows which stay open as long as the user wants.
I have loaded WINLIB3 and D3DLIB and MDILIB. I have tried my aging best to set up for MDI multiple windows. I have noted, and incorporated, the need to close these (especially if error). I am starting with only one child window, and think I have passed hwindow% correctly. I am getting one too many windows opened (but not the regular "console" window) and nothing gets written to anything (using PRINT ".."as a simple test).
Do I need to use the MDI routines to achieve my goal?
Is there perhaps some example code which will do only what I want (i.e. a minimal listing)?
Any help a bonus when in despair of ignorance. rolleyes
--Grahame
Re: How to spawn 1-3 child windows for graphics
Post by Michael Hutton on Sep 3rd, 2009, 05:55am

Grahame,

Richard has uploaded pipeclient in the files/micellaneous area of the Yahoo group. His original message on the group was:

Quote:
I've now uploaded the source files. I've amended the programs so that you can set the title string(s) of the server window(s):

http://groups.yahoo.com/group/bb4w/files/Miscellaneous/pipeclient.bbc
http://groups.yahoo.com/group/bb4w/files/Miscellaneous/pipeserver.bbc

There's not a lot of checking (for example if 'pipeserver. bbc' isn't in the same directory as the client program it will just hang) but that could be added if felt to be important. If compiling a 'pipe client' program make sure you embed @dir$+"pipeserver. bbc" and @lib$+"..\bbcwrun. exe".

Richard.


I can't actually locate it at the moment because the Yahoo search facility seems to be down, so I can't give you the message number.

I hope this is what you are looking for.

Michael
Re: How to spawn 1-3 child windows for graphics
Post by admin on Sep 3rd, 2009, 08:40am

Quote:
I need to open (and draw to) a series of child (?) windows which stay open as long as the user wants.

What kind of 'drawing' do you want to do to these Windows? If the drawing can be easily achieved using Windows API (GDI) calls then the simplest way to achieve what you want is probably to use 'Picture Boxes' (Static Controls with the SS_BITMAP style) as your child windows.

If you want to do 'BBC BASIC-style' drawing (i.e. using the built-in graphics features of BB4W) then it gets more difficult. The MDI approach might work, but Windows isn't very flexible when it comes to adapting MDI to slightly out-of-the-ordinary uses.

As Michael says, you could use the pipeserver/pipeclient approach, but that does mean each of your 'child' windows would be running as a separate process, which might be considered overkill.

If you can explain in a little more detail exactly what you want to achieve I should be able to help further.

Richard.
Re: How to spawn 1-3 child windows for graphics
Post by admin on Sep 7th, 2009, 12:06pm

Quote:
I need to open (and draw to) a series of child (?) windows which stay open as long as the user wants

The new MULTIWIN library should allow you to do exactly what you want:

http://bb4w.conforums.com/index.cgi?board=libraries&action=display&num=1252319955&start=0

Richard.