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:
@ -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)
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user