MyFirstWindow:TGadget=CreateWindow("My Window Title is Hello
World", 200,200,320,240) Repeat WaitEvent() Until EventID()=EVENT_WINDOWCLOSE End |
MyFirstWindow:TGadget=CreateWindow("My Window Title is Hello
World", 200,200,320,240) |
Repeat WaitEvent() Until EventID()=EVENT_WINDOWCLOSE End |
Function CreateWindow:TGadget(name$,x,y,w,h,group:TGadget=Null,style=15) |
Constant | Meaning | |
---|---|---|
WINDOW_TITLEBAR | The Window has a titlebar that displays it's name | |
WINDOW_RESIZABLE | The Window can be resized by the user | |
WINDOW_MENU | The Window has a menubar | |
WINDOW_STATUS | The Window has a statusbar | |
WINDOW_TOOL | The Window is rendered on some platforms with a reduced titlebar | |
WINDOW_CLIENTCOORDS | The dimensions specified relate to the client area not the window frame | |
WINDOW_HIDDEN | The Window is created in a hidden state | |
WINDOW_ACCEPTFILES | Enable drag and drop operations |
MyFirstWindow:TGadget=CreateWindow("My Window with WINDOW_TITLEBAR", 200,200,320,240,Null,WINDOW_TITLEBAR) Repeat WaitEvent() Until EventID()=EVENT_WINDOWCLOSE End |
MaxGUI allows you to create windows with different combination of styles. In does this by using a special function called | which is pronounced OR.
For example to have a window with a title and make it resizable we do the following
MyFirstWindow:TGadget=CreateWindow("My Window with WINDOW_TITLEBAR", 200,200,320,240,Null,WINDOW_TITLEBAR|WINDOW_RESIZABLE) Repeat WaitEvent() Until EventID()=EVENT_WINDOWCLOSE End |
We can now see that the newly created window can be resized, minimized and maximized.
Local style = WINDOW_TITLEBAR|WINDOW_RESIZABLE|WINDOW_MENU|WINDOW_STATUS MyFirstWindow:TGadget=CreateWindow("My Window with WINDOW_TITLEBAR", 200,200,320,240,Null,style) Repeat WaitEvent() Until EventID()=EVENT_WINDOWCLOSE End |
Local style = WINDOW_TITLEBAR|WINDOW_RESIZABLE|WINDOW_MENU|WINDOW_STATUS Print "The Value of Style is "+style MyFirstWindow:TGadget=CreateWindow("My Window with WINDOW_TITLEBAR", 200,200,320,240,Null,style) Repeat WaitEvent() Until EventID()=EVENT_WINDOWCLOSE End |
Local style = WINDOW_TITLEBAR | WINDOW_RESIZABLE | WINDOW_MENU | WINDOW_STATUS | WINDOW_CLIENTCOORDS MyFirstWindow:TGadget=CreateWindow("My Window with WINDOW_TITLEBAR", 200,200,320,240,Null,style) Repeat WaitEvent() Until EventID()=EVENT_WINDOWCLOSE End |
Local style = WINDOW_TITLEBAR | WINDOW_RESIZABLE | WINDOW_STATUS | WINDOW_CLIENTCOORDS MyFirstWindow:TGadget=CreateWindow("My Window with WINDOW_TITLEBAR", 200,200,320,240,Null,style) Repeat WaitEvent() SetStatusText MyFirstWindow, "My current size (w,h) is " + ClientWidth(MyFirstWindow)+ "," + ClientHeight(MyFirstWindow) Until EventID()=EVENT_WINDOWCLOSE End |
SetStatusText MyFirstWindow, "My current size (w,h) is " + ClientWidth(MyFirstWindow)+ "," + ClientHeight(MyFirstWindow) |
Function SetStatusText( window:TGadget,text$ ) |
Local style = WINDOW_TITLEBAR | WINDOW_RESIZABLE | WINDOW_STATUS | WINDOW_CLIENTCOORDS MyFirstWindow:TGadget=CreateWindow("My Window with WINDOW_TITLEBAR", 200,200,320,240,Null,style) Repeat WaitEvent() Local text$= "My current size (w,h) is " + ClientWidth(MyFirstWindow)+ "," + ClientHeight(MyFirstWindow) SetStatusText MyFirstWindow, text$ Until EventID()=EVENT_WINDOWCLOSE End |