Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!news.duke.edu!godot.cc.duq.edu!hudson.lm.com!netline-fddi.jpl.nasa.gov!marsupial.jpl.nasa.gov!llyene!wlbr!voder!gatekeeper.nsc.com!psinntp!psinntp!psinntp!adcmail!gerg
From: gerg@atlas.com (Bill Gergen)
Subject: Create control dynamically in V/Win 2.0?
Message-ID: <1995Jan31.015012.20708@atlas.com>
Organization: Atlas Telecom Inc.
Date: Tue, 31 Jan 1995 01:50:12 GMT
Lines: 32

I'm having trouble trying to create a Windows control (e.g. Button,
StaticText, etc) dynamically (i.e. after the application ViewManager
sub-class has been "opened").  Can someone give me a hint or point
me in the right direction?

Based on examples in the documentation, this appears to be the normal
sequence of events in creating a Windows control:

    1.  One normally adds control objects to the TopPane via
        ViewManager>>addSubPane: .

    2.  ViewManager>>openWindow is sent to create the window.
    
    3.  This eventually builds the window frame by triggering
        the sending of ApplicationWindow>>wmCreate:with:
        
    4.  This recursively performs a ControlPane>>buildWindow:
        on all of its children.
        
I'm trying to simulate the fourth step by invoking initSize:
and buildWindow: on the ControlPane I want to build dynamically.
I believe that Windows is creating the control from
Window>>create:title:style:rectangle:parent: because the
control is assigned a Windows handle, but nothing shows up
on the display.  I've even sent it the validate and showWindow
messages after creation.  Also, using the inspector on the
new ControlPane shows nothing unusual.

By the way, the reason I'm trying to do this is because I've got
a browser that eats Windows resources.  It has many groups of
controls that get shown or hidden based on the kind of object
that is currently selected.
