|
Post by packetteer on Jan 7, 2014 1:56:56 GMT 1
HI All I am doing something wrong. Could someone please point it out to me?
'************************************************************************ ' PROGRAM: MyForm ' PURPOSE: ' AUTHOR: ' WEB SITE: ' DEPENDS: gcc,bacon,GTK ' PLATFORM: Puppy Linux (actually, any *nix) ' DATE: ' LICENSE: '************************************************************************ 'OPTION INTERNATIONAL TRUE REM .po/.mo files have 'charset=UTF-8', so either set UTF-8 on in LANG variable, or do this... 'SETENVIRON "OUTPUT_CHARSET", UTF-8 INCLUDE "/usr/share/BaCon/hug.bac" HUGOPTIONS("BASEXFTDPI 78") HUGOPTIONS("FONT DejaVu Sans 12") MyForm = WINDOW("This is my form",749,561) SetupTab=NOTEBOOK("Tab1",322,105) ATTACH(MyForm,SetupTab,385,441) HelloTxt=ENTRY("Hello",91,21) ATTACH(MyForm,HelloTxt,413,480) ButCmd1=BUTTON("But1",70,21) ATTACH(MyForm,ButCmd1,532,501) TEXT(SetupTab,"Tab2") WorldTxt=ENTRY("World",91,21) ATTACH(MyForm,WorldTxt,413,480) ButCmd2=BUTTON("But2",70,21) ATTACH(MyForm,ButCmd2,525,494) TEXT(SetupTab,"Tab3") HelloWorldTxt=ENTRY("Hello World",133,21) ATTACH(MyForm,HelloWorldTxt,420,480) SET(SetupTab,1) DISPLAY
When I run the above code My Widgets look to be all on the first tab. They all display.
Also ever tho I have SET(SetupTab,1) It looks like Tab2 is active. Any help will be greatly appreciated.
Thank you for your time in reading this post Best Regards John
|
|
|
Post by alexfish on Jan 7, 2014 2:34:18 GMT 1
Hi Packetteer
hope U find this of use
BR Alex
'OPTION INTERNATIONAL TRUE REM .po/.mo files have 'charset=UTF-8', so either set UTF-8 on in LANG variable, or do this... 'SETENVIRON "OUTPUT_CHARSET", UTF-8 INCLUDE "/usr/share/BaCon/hug.bac" HUGOPTIONS("BASEXFTDPI 78") HUGOPTIONS("FONT DejaVu Sans 12") MyForm = WINDOW("This is my form",749,561)
'@ set up notebook with three tabs 0 to 2 SetupTab=NOTEBOOK("Tab0",749,561) TEXT(SetupTab,"Tab1") TEXT(SetupTab,"Tab2") ATTACH(MyForm,SetupTab,0,0)
'@ set notebook to 0 SET(SetupTab,0)
HelloTxt=ENTRY("Hello",91,21) '@ attach notebook to TAB 0 ATTACH(SetupTab,HelloTxt,10,10)
'@ make a button use -1 to allow gtk to set the default size ButCmd1=BUTTON("But1",-1,-1) ATTACH(SetupTab,ButCmd1,10,60)
'@ switch to notebook page 1 SET(SetupTab,1) WorldTxt=ENTRY("World",91,21) ATTACH(SetupTab,WorldTxt,10,10)
'@ button with user set size ButCmd2=BUTTON("But2",70,21) ATTACH(SetupTab,ButCmd2,10,60)
'@ switch to notebook page 2 SET(SetupTab,2) HelloWorldTxt=ENTRY("Hello World",133,21) ATTACH(SetupTab,HelloWorldTxt,100,100)
'@ return to tab 0 SET(SetupTab,0)
'@ note for tabs to be activly active ensure the gtk widget are within the bounds ' of the notebook , else tabs may not respond , not allways but some times
DISPLAY
|
|
|
Post by packetteer on Jan 8, 2014 0:16:59 GMT 1
HI Alex I ran your code and it worked just fine. Now all I need to do is apply what you taught me to my code. Thank you so much.
Best Regards John
|
|
|
Post by alexfish on Jan 8, 2014 1:00:36 GMT 1
Anytime There is is nice tutorial about widget placement , started by Joe , anyone new to BaCon and wants to get to know HUG widgets then can also look HEREBR Alex
|
|