Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Mar 5, 2014 21:46:25 GMT 1
REMOVED
|
|
|
Post by konaexpress on Mar 5, 2014 22:42:54 GMT 1
(Big Sigh)
|
|
|
Post by alexfish on Mar 6, 2014 3:03:57 GMT 1
@ John Spikowski. Firstly I would like to thank you for introducing BBC graphic commands to BaCon ,also thanks to Vovchik & Joe for been involved. Although I did not have much input on the Thread I did what I could whilst researching the colour contexts , by a request from Vovchik , the results and possible solution was posted to Vovchik, 'IE a match that = recent versions of BBC Basic.' , who then relayed them to the thread. During the life time of thread which was very short , and of which you ask to be closed , I found a possible reason that the use of SDL graphics may not be suitable for modern day BBC graphics. hence I felt more research was required. Best Explained here cairo/sdlas a pointer it comes down to 32 bit including Alpha and 24 bit including Alpha + colour shifting. Results of cairo with sdl and method of , was posted on the SDL thread . HTH Alex
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Mar 6, 2014 3:18:56 GMT 1
REMOVED
|
|
|
Post by Pjot on Mar 6, 2014 22:50:45 GMT 1
All, The latest beta now also allows the '*' symbol attached to the variable name (or attached to the type name). Fixes for static array dimensions. Also I have put the compilation of functions in alphabetic order. BR, Peter
|
|
|
Post by alexfish on Mar 7, 2014 2:05:03 GMT 1
Hi Peter
* looks interesting , can U check the Printed values of this bit of code
DECLARE *x double DECLARE *y long DECLARE z NUMBER DECLARE zz int x=5.5999 y= 87.99999996 z= 66789.9188 zz = 1234.56789 PRINT x , " : ",y," : ", z," : ", zz,
BR Alex
|
|
|
Post by Pjot on Mar 7, 2014 20:12:14 GMT 1
Hi Alex, The code compiles, but the syntax for DECLARE/GLOBAL is wrong (missing TYPE keyword). I will add a check for this. So those printed values are rubbish, of course. Thanks, Peter
|
|
peba
New Member
Posts: 6
|
Post by peba on May 18, 2014 19:41:11 GMT 1
stepval = 0.1 FOR loop=0 TO 10 STEP stepval PRINT "Value: ",loop NEXT
Output: Value: 0 Value: 0 Value: 0 ...
looks like a stepval < 1 can't be used with bacon 3.0.1 beta
|
|
|
Post by alexfish on May 18, 2014 20:04:50 GMT 1
Hi peba
looks like BaCon is getting stricter in terms of variable TYPES
looking at the code possible default loop may be integer
this code should work
HTH Alex
LOCAL stepval = 0.1 TYPE double LOCAL loop TYPE double FOR loop=0 TO 10 STEP stepval PRINT "Value: ",loop NEXT
|
|
|
Post by Pjot on May 18, 2014 22:02:09 GMT 1
Hi Peba, This construction has never worked in BaCon, and Alex is right: in such cases usually you have to specify the type explicitly. Nevertheless, with the new variable type detection mechanism in place, it was easy to fix. Please checkout the latest beta and hopefully this works for you. BR Peter
|
|
peba
New Member
Posts: 6
|
Post by peba on May 19, 2014 19:38:10 GMT 1
Hi Pjot,
1. For-next loop with small step value (double) in variable works perfect now.
2. When starting and quitting bacongui i see the following output on the Command Line: bacongui (bacongui:16071): GtkSourceView-CRITICAL **: gtk_source_style_scheme_get_id: assertion `GTK_IS_SOURCE_STYLE_SCHEME (scheme)' failed
3. Whats wrong with this code ?
x0=8 y0=5 x1=x0+1 y1=y0+1
During Translation this message is shown: In file included from vartest.bac.c:2:0: vartest.bac.h:6:6: error: 'y0' redeclared as different kind of symbol vartest.bac.h:10:6: error: 'y1' redeclared as different kind of symbol make: *** [vartest.bac.o] Error 1
4. Where could I donate to the BaCon project (paypal ) ?
Best Regards, Peter
|
|
|
Post by Pjot on May 19, 2014 21:21:57 GMT 1
Hi Peter, 1 - OK! 2 - it could be that your system has not all GtkSourceView themes installed. You can try to change the theme in Options->Select Theme. The "classic" theme should be available. 3 - the variable names y0, y0f, y0l, y1, y1f, y1l, yn, ynf, ynl are reserved in libm. You can also find them in the man pages: man y0. So these belong to reserved C variables and therefore cannot be redefined in a BaCon program. 4 - you can find a Paypal button on the BaCon website. Thanks! Peter
|
|
|
Post by packetteer on May 30, 2014 11:41:19 GMT 1
Hi Peter The following program does not work in version 3.0.1 The program is your GTK demo program. Here is the program so you do not have to search this list to find it.
PRAGMA LDFLAGS `pkg-config --cflags --libs gtk+-2.0` PRAGMA INCLUDE gtk-2.0/gtk/gtk.h
PROTO gtk_init, gtk_window_new, gtk_window_set_title, gtk_window_set_position, gtk_widget_set_size_request PROTO g_signal_connect_data, gtk_table_new, gtk_container_add, gtk_button_new_with_label PROTO gtk_table_attach_defaults, gtk_widget_show_all, gtk_main
LOCAL *win,*grid,*button TYPE GtkWidget
gtk_init(0, 0)
win = gtk_window_new(GTK_WINDOW_TOPLEVEL) gtk_window_set_title(GTK_WINDOW(win), "GTK demo") gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_CENTER) gtk_widget_set_size_request(win, 300, 350) g_signal_connect_data(win, "delete-event", G_CALLBACK(gtk_exit), 0, 0, 0)
grid = gtk_table_new(55, 50, 1) gtk_container_add(GTK_CONTAINER(win), grid)
button = gtk_button_new_with_label("Quit") gtk_table_attach_defaults(GTK_TABLE(grid), button, 41, 49, 44, 50) g_signal_connect_data(button, "clicked", G_CALLBACK(gtk_exit), 0, 0, 0)
gtk_widget_show_all(win)
gtk_main
The error I get is file '/usr/include/gtk-2.0/gtk/gtk.h' Line 32: #include <gdk/gdk.h> Cause: No such file or directory
If I edit the gtk.h file and change line 32 to a full path then it works but then another error shows up. In the GDK.h file line 32 is another include and says file not found. At that point I edited the GTK.h file and put line 32 back to what it was.
Today I down loaded bacon version 2.4.0 and ran the above program in 2.4.0 the above program ran fine so it is not something that I did to my system.
I am using Puppy Linux Slacko 5.7
Thank you Peter for your time in reading this E-Mail Best Regards John
|
|
|
Post by bigbass on May 30, 2014 14:33:32 GMT 1
Hey packetteer If you want to embed pure gtk so it looks like gtk you need the headersand I see it isn't compiling that way at the moment But if you dislike gtk syntax you can nuke the headers and rewrite the code in a simplified way using the same example you posted with a different spin Now if you really want use gtk but prefer HUG/BASIC looking syntax call the commands with simplified new names using an ALIAS now this just shows we can make the code somewhat more friendly to read since we do not use the header we declare CONST GTK_WIN_POS_NONE = 0 CONST GTK_WIN_POS_CENTER = 1 those are the only things needed from the headers anyway in this example nuke2.bac
PRAGMA LDFLAGS gobject-2.0 PRAGMA LDFLAGS gtk-x11-2.0
PROTO gtk_init ALIAS INIT PROTO gtk_window_new ALIAS WINDOW PROTO gtk_window_set_title ALIAS TITLE PROTO gtk_window_set_position ALIAS POSITION PROTO gtk_widget_set_size_request ALIAS WINDOW_SIZE PROTO g_signal_connect_data ALIAS CALLBACK PROTO gtk_table_new ALIAS TABLE PROTO gtk_container_add ALIAS CONTAINER PROTO gtk_button_new_with_label ALIAS BUTTON PROTO gtk_table_attach_defaults ALIAS ATTACH_TABLE PROTO gtk_widget_show_all ALIAS SHOW PROTO gtk_main ALIAS DISPLAY PROTO gtk_main_quit ALIAS QUIT
CONST GTK_WIN_POS_NONE = 0 CONST GTK_WIN_POS_CENTER = 1
SUB exit_prog gtk_main_quit END SUB
INIT(0, 0)
win = WINDOW() TITLE(win, "GTK demo") POSITION(win, GTK_WIN_POS_CENTER) WINDOW_SIZE(win, 300, 350) CALLBACK(win, "delete-event", exit_prog, 0, 0, 0)
grid = TABLE(55, 50, 1) CONTAINER(win, grid)
button = BUTTON("Quit") ATTACH_TABLE(grid, button, 41, 49, 44, 50) CALLBACK(button, "clicked", exit_prog, 0, 0, 0)
SHOW(win)
DISPLAY
if you need to see the transformation step code that looks closer to gtk but no casting and no headersthe same code again PRAGMA LDFLAGS gobject-2.0 PRAGMA LDFLAGS gtk-x11-2.0
PROTO gtk_init, gtk_window_new, gtk_window_set_title, gtk_window_set_position, gtk_widget_set_size_request PROTO g_signal_connect_data, gtk_table_new, gtk_container_add, gtk_button_new_with_label PROTO gtk_table_attach_defaults, gtk_widget_show_all, gtk_main,gtk_main_quit
CONST GTK_WIN_POS_NONE = 0 CONST GTK_WIN_POS_CENTER = 1
SUB exit_prog gtk_main_quit END SUB
gtk_init(0, 0)
win = gtk_window_new() gtk_window_set_title(win, "GTK demo") gtk_window_set_position(win, GTK_WIN_POS_CENTER) gtk_widget_set_size_request(win, 300, 350) g_signal_connect_data(win, "delete-event", exit_prog, 0, 0, 0)
grid = gtk_table_new(55, 50, 1) gtk_container_add(win, grid)
button = gtk_button_new_with_label("Quit") gtk_table_attach_defaults(grid, button, 41, 49, 44, 50) g_signal_connect_data(button, "clicked", exit_prog, 0, 0, 0)
gtk_widget_show_all(win)
gtk_main
|
|
|
Post by vovchik on May 30, 2014 15:43:34 GMT 1
Dear guys, There is a problem with the latest - 29 May - BaCon beta. It is not finding headers. Perhaps the syntax changed for the INCLUDE or something else. I think Peter will have a look as soon as he can. With kind regards, vovchik PS. The latest release that works in the old way (i.e., finds headers where it used to) is the second 18 May beta (two versions that day), to the best of my knowledge.
|
|