Project

General

Profile

Actions

Create a window in Scol

A window is a base of all graphic interface ; it is a container. The Scol type is ObjWin.

Creation

To create a window, simple use the Scol function *_CRwindow*

<window_object> _CRwindow <channel_object> <father_object> <initial_position_x> <initial_position_y> <initial_width> <initial_height> <option_flags> <title>

  1. <channel_object> : the proprietary channel. If nil, the windown can not be created, if the channel os closed, the window will be destroyed. Typically, it is the current channel (_channel)
  2. <father_object> : the parent window, if any. If no parent, you should set to nil this argument.
  3. <initial_position_x>
  4. <initial_position_y>
  5. <initial_width>
  6. <initial_height> : position and size when the window is created
  7. <option_flags> : several flags are availables to customize the window (see doc)
  8. <title> : a title, if any

You can directly hide a window. In this case, don't forget to show it when needed (_SHOWwindow) !

You can also create a window object with scroll : _CRscrollWindow

Destruction

To destroy a window object, use _DSwindow

<integer> _DSwindow <object_window>

If the <object_window> is already destroyed, nothing to do. If the <object_window> is stored in a global variable, you should always set it to nil after the destruction of the object.

Example :

typeof window = ObjWin;;

fun end ()=
    _DSwindow window;
    _closemachine;;

fun create ()=
    set window = _CRwindow _channel nil 0 0 320 240 WN_NORMAL "My first window !";
    _fooS if window == nil then
              "Unable to create this window" 
          else
              "The window has been created";
    0;;

fun main ()=
    _showconsole;
    create;
    // other things
    0;;

Updated by iri about 12 years ago · 1 revisions