September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
|
|
@ -1,14 +1,16 @@
|
|||
let () =
|
||||
let app = SFRenderWindow.make (640, 480) "OCaml-SFML Windowing" in
|
||||
open Sdl
|
||||
|
||||
let rec loop() =
|
||||
let continue =
|
||||
match SFRenderWindow.getEvent app with
|
||||
| Some SFEvent.Closed -> false
|
||||
| _ -> true
|
||||
in
|
||||
SFRenderWindow.clear app SFColor.black;
|
||||
SFRenderWindow.display app;
|
||||
if continue then loop()
|
||||
let () =
|
||||
let width, height = (640, 480) in
|
||||
Sdl.init [`VIDEO];
|
||||
let window, renderer =
|
||||
Render.create_window_and_renderer
|
||||
~width ~height ~flags:[]
|
||||
in
|
||||
loop()
|
||||
let rgb = (0, 255, 0) in
|
||||
let a = 255 in
|
||||
Render.set_draw_color renderer rgb a;
|
||||
Render.clear renderer;
|
||||
Render.render_present renderer;
|
||||
Timer.delay 3000;
|
||||
Sdl.quit ()
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
open Xlib
|
||||
|
||||
let () =
|
||||
let d = xOpenDisplay "" in
|
||||
let s = xDefaultScreen d in
|
||||
let w = xCreateSimpleWindow d (xRootWindow d s) 10 10 100 100 1
|
||||
(xBlackPixel d s) (xWhitePixel d s) in
|
||||
xSelectInput d w [KeyPressMask];
|
||||
xMapWindow d w;
|
||||
let _ = xNextEventFun d in (* waits any key-press event *)
|
||||
xCloseDisplay d;
|
||||
;;
|
||||
let app = SFRenderWindow.make (640, 480) "OCaml-SFML Windowing" in
|
||||
|
||||
let rec loop () =
|
||||
let continue =
|
||||
match SFRenderWindow.pollEvent app with
|
||||
| Some SFEvent.Closed -> false
|
||||
| _ -> true
|
||||
in
|
||||
SFRenderWindow.clear app SFColor.black;
|
||||
SFRenderWindow.display app;
|
||||
if continue then loop ()
|
||||
in
|
||||
loop ()
|
||||
|
|
|
|||
12
Task/Window-creation/OCaml/window-creation-7.ocaml
Normal file
12
Task/Window-creation/OCaml/window-creation-7.ocaml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
open Xlib
|
||||
|
||||
let () =
|
||||
let d = xOpenDisplay "" in
|
||||
let s = xDefaultScreen d in
|
||||
let w = xCreateSimpleWindow d (xRootWindow d s) 10 10 100 100 1
|
||||
(xBlackPixel d s) (xWhitePixel d s) in
|
||||
xSelectInput d w [KeyPressMask];
|
||||
xMapWindow d w;
|
||||
let _ = xNextEventFun d in (* waits any key-press event *)
|
||||
xCloseDisplay d;
|
||||
;;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
use Gtk '-init';
|
||||
use Gtk3 '-init';
|
||||
|
||||
$window = Gtk::Window->new;
|
||||
$window = Gtk3::Window->new;
|
||||
$window->signal_connect(
|
||||
destroy => sub { Gtk->main_quit; }
|
||||
destroy => sub { Gtk3->main_quit; }
|
||||
);
|
||||
$window->show_all;
|
||||
Gtk->main;
|
||||
Gtk3->main;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
use Gtk2 '-init';
|
||||
use strict;
|
||||
use warnings;
|
||||
use QtGui4;
|
||||
|
||||
$window = Gtk2::Window->new;
|
||||
$window->signal_connect(
|
||||
destroy => sub { Gtk2->main_quit; }
|
||||
);
|
||||
$window->show_all;
|
||||
Gtk2->main;
|
||||
my $app = Qt::Application(\@ARGV);
|
||||
my $window = Qt::MainWindow;
|
||||
$window->show;
|
||||
exit $app->exec;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
use QtGui4;
|
||||
use Wx;
|
||||
|
||||
my $app = Qt::Application(\@ARGV);
|
||||
my $window = Qt::MainWindow;
|
||||
$window->show;
|
||||
exit $app->exec;
|
||||
$window = Wx::Frame->new(undef, -1, 'title');
|
||||
$window->Show;
|
||||
Wx::SimpleApp->new->MainLoop;
|
||||
|
|
|
|||
|
|
@ -1,16 +1,10 @@
|
|||
--
|
||||
-- demo\rosetta\Window_creation.exw
|
||||
--
|
||||
include pGUI.e
|
||||
|
||||
function esc_close(Ihandle /*ih*/, atom c)
|
||||
return iff(c=K_ESC?IUP_CLOSE:IUP_CONTINUE)
|
||||
end function
|
||||
|
||||
IupOpen()
|
||||
Ihandle dlg = IupDialog(IupVbox({IupLabel("hello")},"MARGIN=200x200"))
|
||||
IupSetAttribute(dlg,"TITLE","Hello")
|
||||
IupSetCallback(dlg, "K_ANY", Icallback("esc_close"))
|
||||
IupCloseOnEscape(dlg)
|
||||
IupShow(dlg)
|
||||
IupMainLoop()
|
||||
IupClose()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue