1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ui: Objective-C @interface support for Cocoa; minor clean-ups

This commit is contained in:
Alexander Medvednikov
2019-09-21 21:38:12 +03:00
parent fbc19311b5
commit bf1ee28194
11 changed files with 112 additions and 89 deletions

View File

@ -42,7 +42,7 @@ fn (ctx &Context) draw() {
ctx.gg.draw_line(Size / 2, 0, Size / 2, Size) // y axis
center := f64(Size / 2)
for x := -10.0; x <= 10.0; x += 0.002 {
y := x * x + 1
y := x * x - 1
//y := (x + 3) * (x + 3) - 1
//y := math.sqrt(30.0 - x * x)
ctx.gg.draw_rect(center + x * Scale, center - y * Scale, 1, 1, gx.Black)

View File

@ -1,18 +1,18 @@
// Build this example with
// v -live message.v
// v -live message.v
module main
import time
[live]
[live]
fn print_message() {
println('Hello! Modify this message while the program is running.')
println('Hello! Modify this message while the program is running.')
}
fn main() {
for {
print_message()
time.sleep_ms(500)
time.sleep_ms(500)
}
}