GLBasic forum

Main forum => Announcements => Topic started by: Kitty Hello on 2008-Oct-30

Title: GUI comes
Post by: Kitty Hello on 2008-Oct-30
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:
(http://img222.imageshack.us/img222/3330/dialog176pngsh3.th.png) (http://img222.imageshack.us/my.php?image=dialog176pngsh3.png)(http://img222.imageshack.us/images/thpix.gif) (http://g.imageshack.us/thpix.php)

...really. I'm so excited, I clicked "buy me a beer" 5 times already :S
Title: Re: GUI comes
Post by: MrTAToad on 2008-Oct-31
Looks rather good!
Title: Re: GUI comes
Post by: Quentin on 2008-Oct-31
great work. And it runs within a normal GLBasic window?
Title: Re: GUI comes
Post by: bigsofty on 2008-Oct-31
 :good: Very good and I like the syntax! Well done Gernot!
Title: Re: GUI comes
Post by: Quentin on 2008-Nov-01
You're right. Now I see it. But I'm not sure if I really understand what's going on in this window  :S
Title: Re: GUI comes
Post by: Hatonastick on 2008-Nov-01
To quote the Dad in 'Calvin and Hobbes': 'It's magic!'.  Like everything else technical in the world. :D
Title: Re: GUI comes
Post by: Hemlos on 2008-Nov-01
HK you tease!

Someone get that man a beer! ;)
Title: Re: GUI comes
Post by: BumbleBee on 2008-Nov-01
Quote from: Hemlos
  Someone get that man a beer!

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

Cheers
Title: Re: GUI comes
Post by: MrTAToad on 2008-Nov-01
Will this mean that buttons and whatnot can be placed anywhere and retain this position when a window size changes ?
Title: Re: GUI comes
Post by: MrTAToad on 2008-Nov-01
It looks pretty powerful.