GUI comes

Previous topic - Next topic

Kitty Hello

Code (glbasic) Select

tk_pushdialog(200, 300, "Dialog 1")

// n1
widg% = tk_widget("some widget")
// n1
tk_framestart("test1")
combo%= tk_combobox("one|two|three")
tk_framestart()
but%  = tk_button("Exit", "on_exit")
text% = tk_text("Edit me")
tk_frameend()
tk_frameend()
// n1
tk_framestart()
radio%= tk_radio("One|Two|Three")
tk_newline()
check%= tk_checkbox("Check me")
tk_newline()
list% = tk_listbox("one ( 1 )|two|three", FALSE)
ogl% = tk_opengl(320,320)
tk_frameend()


tk_set_val(list%, 2)

AUTOPAUSE FALSE
WHILE TRUE
tk_main_loop()

DRAWRECT 0,0,60*SIN(GETTIMERALL()/10),60,RGB(255,0,0)

PRINT tk_get_text$(widg%)  + ":" + tk_get_val$(widg%) ,0,0
PRINT tk_get_text$(but%)   + ":" + tk_get_val$(but%)  ,0,20
PRINT tk_get_text$(text%)  + ":" + tk_get_val$(text%) ,0,40
PRINT tk_get_text$(radio%) + ":" + tk_get_val$(radio%),0,60
PRINT tk_get_text$(check%) + ":" + tk_get_val$(check%),0,80
PRINT tk_get_text$(list%)  + ":" + tk_get_val$(list%),0,100
PRINT tk_get_text$(combo%) + ":" + tk_get_val$(combo%),0,120

tk_gl_swap(ogl%) // SHOWSCREEN
WEND


SUB on_exit:
END
ENDSUB


result:


...really. I'm so excited, I clicked "buy me a beer" 5 times already :S

MrTAToad

Looks rather good!

Quentin

great work. And it runs within a normal GLBasic window?

bigsofty

 :good: Very good and I like the syntax! Well done Gernot!
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Quentin

You're right. Now I see it. But I'm not sure if I really understand what's going on in this window  :S

Hatonastick

#5
To quote the Dad in 'Calvin and Hobbes': 'It's magic!'.  Like everything else technical in the world. :D

Hemlos

HK you tease!

Someone get that man a beer! ;)
Bing ChatGpt is pretty smart :O

BumbleBee

Quote from: Hemlos
  Someone get that man a beer!

Or two or three.... But don't drink and type, Kitty. ;)

Cheers
The day will come...

CPU Intel(R) Core(TM) i5-3570k, 3.4GHz, AMD Radeon 7800 , 8 GB RAM, Windows 10 Home 64Bit

MrTAToad

Will this mean that buttons and whatnot can be placed anywhere and retain this position when a window size changes ?

MrTAToad

It looks pretty powerful.