Window creation/X11: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 662: | Line 662: | ||
nativeHeap.free(e) |
nativeHeap.free(e) |
||
}</lang> |
}</lang> |
||
=={{header|M2000 Interpreter}}== |
|||
M2000 interpteter is a Visual Basic 6 (vb6) gui application, so we can't use X11. When we use Wine, connecting to X11 may occur but this is invisible for interpreter scope. |
|||
Ao for this task we use the M2000 way to make a form and do something on it. |
|||
<lang M2000 Interpreter> |
|||
\\ M2000 froms (windows) based on a flat, empty with no title bar, vb6 window and a user control. |
|||
\\ title bar is a user control in M2000 form |
|||
\\ On linux, wine application run M2000 interpreter traslating vb6 calls to window system. |
|||
Module SquareAndText2Window { |
|||
Const black=0, white=15 |
|||
Declare form1 form |
|||
\\ defaultwindow title is the name of variable,here is: form1 |
|||
Rem With form1, "Title", "A title for this window" |
|||
Method form1,"move", 2000,3000,10000,8000 ' in twips |
|||
layer form1 { |
|||
Cls white |
|||
Font "Verdana" |
|||
Rem Window 12 , 10000,8000; ' hide modr 13 using a REM before |
|||
Rem |
|||
Mode 12 ' 12 in pt |
|||
Cls white, 2 ' fill white, set third raw for top of scrolling frame |
|||
Pen black |
|||
Move 1000,2000 ' absolute coordinated in twips - use Step for relative coordinates |
|||
\\ polygon use relative coordinates in twips |
|||
polygon white, 1000,0,0,-1000,-1000,0,0,-1000 |
|||
\\ write text using graphic coordinates |
|||
Move 1000, 3000 : Legend "Hello World", "Arial", 12 |
|||
\\ write text using layer as console (font Verdana) |
|||
Print @(15,5),"Goodbye Wolrd" |
|||
\\ 9120 7920 if we use window 12,10000, 8000 (cut exactly for console use) |
|||
\\ 10000 8000 if we use Mode 12 |
|||
\\ scale.y include window height (including header) |
|||
\\ the layer extend bellow |
|||
Print scale.x, scale.y |
|||
} |
|||
\\ show form1 modal (continue to next line when we close the window) |
|||
Method form1,"Show", 1 |
|||
\\ closing meand hide in M2000 |
|||
wait 1000 ' in msec |
|||
Method form1,"move", random(2000, 10000),random(3000, 8000) |
|||
\\ now show again |
|||
Method form1,"Show", 1 |
|||
\\ now we close the form, releasing resources |
|||
Declare form1 Nothing |
|||
} |
|||
SquareAndText2Window |
|||
</lang> |
|||
=={{header|Mathematica}}== |
=={{header|Mathematica}}== |
||
Note that GUIKit is a high-level wrapper for Swing. |
Note that GUIKit is a high-level wrapper for Swing. |