Stuck with ApplicationModel 
Author Message
 Stuck with ApplicationModel

Iam just a starter.. If I use the GUI builder to create the
ApplicationModel, how do I draw on the window at runtime..Basically,
when a button is clicked, I get the message clicked on
ApplicationModel class, now I need to draw a Rectangle say.
The code I tried was

clicked

gc:=self mainWindow graphicsContext.

TIA



Sun, 08 May 2005 00:16:20 GMT  
 Stuck with ApplicationModel


Quote:
> Iam just a starter.. If I use the GUI builder to create the
> ApplicationModel, how do I draw on the window at runtime..Basically,
> when a button is clicked, I get the message clicked on
> ApplicationModel class, now I need to draw a Rectangle say.
> The code I tried was

> clicked

> gc:=self mainWindow graphicsContext.


Something that is going to work to get you started is

  Window currentWindow graphicsContext

If you use "Rectangle fromUser" the result may be surprising, because to
make it work properly you have to transform coordinates from screen global
to local to the window.

However, you have to realize that in most current GUI frameworks, there are
really two kinds of drawing on a window.  The rectangle drawn by this
example will not stay on the screen forever.  If you cover that window with
another, and then uncover it, the rectangle will be gone.  It happens
because typical windows do not keep the picture of their content stored in
memory.  Instead, every time they are repainted, they tell the widgets they
contain to repaint themselves.  Since the rectangle you draw on a window is
not one of the widgets and the window has no knowledge about it, it will
not be reproduced.  So, you next step is to figure out how to make it known
to the window...

--
Vassili Bykov [|] vassili "at" parcplace "dot" com
VisualWorks Engineering, Tools Technical Lead
[:s | s, s printString] value: '[:s | s, s printString] value: '



Sun, 08 May 2005 03:08:33 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. From Hickory Sticks to Joy Sticks

2. Color Icons for VW ApplicationModel

3. ApplicationModel initialization idioms.

4. make an ApplicationModel start maximized

5. How to specify a controller for an ApplicationModel ?

6. Changing menu bars in ApplicationModel in PPS VW2.0

7. VW ApplicationModel and Keyboard Events

8. ApplicationModel to View (in VW)

9. Newbie Parsing Question...STUCK

10. Stuck on Snooze!

11. Deliberation topic: stuck while developing

12. Stuck with realbasic

 

 
Powered by phpBB® Forum Software