|
BASM
Dec 8, 2014 18:29:34 GMT 1
Post by alexfish on Dec 8, 2014 18:29:34 GMT 1
Hi Vovchik
hit first snag STRING
if trying to pass string out of hug lib = segfault
DECLARE FUNCTION HUGLIB$ LIB "./hug.so" ALIAS "HUGLIB$" (t AS STRING, ) AS STRING DIM Glib$ AS STRING Glib$ = HUGLIB$("gobject")
BASM Linux - Version 1.0 Build 1 Currently compiling "./gtk.bac": - Compile time -> 0.020000 seconds - Assemble time -> 0.010000 seconds - Linking time -> 0.000000 seconds ------------------------------- - Total time -> 0.030000 seconds alexfish@alexfish:~/Downloads/basm/basm-linux$ ./basm ./gtk.bac
BASM Linux - Version 1.0 Build 1 Currently compiling "./gtk.bac": - Compile time -> 0.020000 seconds - Assemble time -> 0.000000 seconds - Linking time -> 0.000000 seconds ------------------------------- - Total time -> 0.020000 seconds alexfish@alexfish:~/Downloads/basm/basm-linux$ ./gtk Segmentation fault
Alex
what type of String is STRING?
and does Basm have options as char* x
|
|
|
BASM
Dec 8, 2014 18:37:50 GMT 1
Post by vovchik on Dec 8, 2014 18:37:50 GMT 1
Dear Alex, And try this out. After clicking Toggle 6-9 times, which works, I get a segfault. With kind regards, vovchik PS I got callbacks to work like this in straight GTK DECLARE FUNCTION QUIT LIB "libgtk-x11-2.0.so.0" ALIAS "gtk_main_quit" () AS VOID DECLARE FUNCTION SIGNAL LIB "libgobject-2.0.so" ALIAS "g_signal_connect_data" (w AS INTEGER, s AS STRING, c AS INTEGER, x AS INTEGER, y AS INTEGER, z AS INTEGER) AS VOID SIGNAL(win, "destroy", CALLBACK(QUIT), 0, 0, 0)
: Attachments:hugbut1b.bas.tar.gz (45.22 KB)
|
|
|
BASM
Dec 8, 2014 19:04:47 GMT 1
Post by alexfish on Dec 8, 2014 19:04:47 GMT 1
Dear Alex, And try this out. After clicking Toggle 6-9 times, which works, I get a segfault. With kind regards, vovchik PS I got callbacks to work like this in straight GTK DECLARE FUNCTION QUIT LIB "libgtk-x11-2.0.so.0" ALIAS "gtk_main_quit" () AS VOID DECLARE FUNCTION SIGNAL LIB "libgobject-2.0.so" ALIAS "g_signal_connect_data" (w AS INTEGER, s AS STRING, c AS INTEGER, x AS INTEGER, y AS INTEGER, z AS INTEGER) AS VOID SIGNAL(win, "destroy", CALLBACK(QUIT), 0, 0, 0)
: Hi Vochik Working fine here .. Just kind of wondering if it be U'gtk Version , also remember the last M4 editor does not work either.
|
|
Deleted
Deleted Member
Posts: 0
|
BASM
Dec 8, 2014 19:16:47 GMT 1
Post by Deleted on Dec 8, 2014 19:16:47 GMT 1
Hi vovchik & Alex! There is a known issue with CALLBACK and I assume CODEPTR as well. Under Windows it doesn't work at all which has frozen any effort for that platform. I have confirmed with a C & IUP callback example that it's BASM. That is too Kool that you found a workaround for callback. Thanks Alex for joining in and helping vovchik and the project along. As soon as I hear anything from AIR on the callback issue, I'll post it here and the BASM forum which both of you guys are invited to join if you wish. John
|
|
|
BASM
Dec 8, 2014 20:28:07 GMT 1
Post by alexfish on Dec 8, 2014 20:28:07 GMT 1
Hi John & Vovchik
@ John , Thanks for invite , will consider when work load and Xmas out of the way.
In mean time ,
have managed to make contact with g_object_set , as of just now , text to the button failed , now looking into the devs
since it be a while , gtk wise
here are results from terminal
(but:8708): GLib-GObject-WARNING **: g_object_set_valist: object class `GtkButton' has no property named `text'
BR Alex
|
|
|
BASM
Dec 8, 2014 20:31:32 GMT 1
Post by vovchik on Dec 8, 2014 20:31:32 GMT 1
Dear Alex,
That is good news. The reason, I think, that the button has no text property is that the label - that contains the text - is a child widget within the button, so you have to get the child first.
With kind regards, vovchik
gtk_bin_get_child
|
|
Deleted
Deleted Member
Posts: 0
|
BASM
Dec 8, 2014 20:32:13 GMT 1
Post by Deleted on Dec 8, 2014 20:32:13 GMT 1
BASM supports ByRef & ByVal as a prefix to arguments in functions/subs.
FUNCTION test (ByRef s AS STRING, ...)
You need to test this though.
Also there is ADDRESSOF() to get a pointer to a variable.
|
|
|
BASM
Dec 8, 2014 23:15:17 GMT 1
Post by alexfish on Dec 8, 2014 23:15:17 GMT 1
Hi All
have managed to get g_object working , thanks to Vovchik's reminder bin widget
have put two testing sub in the hug.bac
GSET$ for setting textural content of a widget
IE
GSET$(widget,"label","my_text")
and GSET
for widget requiring Numeric possible as in ENUM etc
IE
GSET(widget,"image",ALPHA_TRUE)
it is in for now but will go through the devs to ensure looking at correct... + a round or testing
will then post updated hug if all success..
this is a one for one base no __VAR__ARGS__
BR Alex
picky
|
|
|
BASM
Dec 8, 2014 23:41:18 GMT 1
Post by vovchik on Dec 8, 2014 23:41:18 GMT 1
Dear Alex,
Can't wait to try out your GSET and GSET$. I do think John and I might have GTK problems, too, which would explain the segfaults described above and my M4 editor problems. My version of GTK2 is 2.24.20, which is Mint 16 standard issue.
With kind regards, vovchik
|
|
Deleted
Deleted Member
Posts: 0
|
BASM
Dec 9, 2014 1:25:40 GMT 1
Post by Deleted on Dec 9, 2014 1:25:40 GMT 1
I have already proven that this is a BASM CALLBACK corruption issue on Linux and a non-event (pun intended) on Windows. This is a critical bug that needs to be fixed on both platforms for this project to survive. I have put it in AIR's hands to resolve. Others with ASM knowledge are encouraged to assist.
|
|
|
BASM
Dec 9, 2014 2:50:50 GMT 1
Post by alexfish on Dec 9, 2014 2:50:50 GMT 1
Hi John have been look through the forum for the Nasm demo no find as yet . need some Zzzzzzzzzz. best came up with google . is here . require gtk3. code looks familiar , but sometimes have to tweak the code . only note can make on that one is the dword if problem then best look in the resultant sources . if can track down the posted demo will link it. all other asm now on dead hd/lossed data ,not going to say how that happen. also hence the incomplete/ u Know what willing to the g_object for now , nothing more . at this present time The link HEREBR Alex
|
|
Deleted
Deleted Member
Posts: 0
|
BASM
Dec 9, 2014 3:05:00 GMT 1
Post by Deleted on Dec 9, 2014 3:05:00 GMT 1
I don't have a lot of knowledge with Gtk other than Peter's GTK-Server and playing with the stuff you guy post here. I have standardized on IUP because I only want to write my GUI code once and use it on Windows and Linux. Sure there are trade offs not going direct but for me EASY TO USE and CROSS PLATFORM take precedence over everything else.
|
|
|
BASM
Dec 9, 2014 3:20:25 GMT 1
Post by alexfish on Dec 9, 2014 3:20:25 GMT 1
Hi John
I thought IUP uses gtk on linux .
but for getting started on the project I think a hug.so type lib will give a start esp on linux . we know it works
then if AIR can resolve the callback issue everything will fall in place , it just takes time , only hold up is Xmas
beauty about hug , the BASIC syntax is there , same syntax can be applied to other toolkits , ALIAS.. same SYNTAX same source code / for editor
do that one different then = more time. patience is a virtue esp at this time of year
Best wishes
Alex
Now for Zzzzzzzzzzz.
|
|
Deleted
Deleted Member
Posts: 0
|
BASM
Dec 9, 2014 4:11:52 GMT 1
Post by Deleted on Dec 9, 2014 4:11:52 GMT 1
Yes. There is a Gtk2 driver for IUP on the Linux and Mac platforms. The native Windows API is used for the driver on that platform. IUP code is the same on Windows and Linux. (Portable User Interface - IUP)
I don't see Gtk anything when using IUP even though that is what is going on under the covers.
|
|
|
BASM
Dec 9, 2014 10:11:24 GMT 1
Post by vovchik on Dec 9, 2014 10:11:24 GMT 1
Dear John and Alex,
BASM seems to have a stack problem, which would explain why I can click a button from 6 to 9 times before something bombs:
vovchik$ [~/Public/bacon-tst/BASM/BASM-Linux64/Source/examples]-> ./iupjrsbutton = 49 pressed = 1 x = 60 y = 17 status = 1 *** stack smashing detected ***: ./iupjrs terminated
I hope AIR can make sense of that error...
With kind regards, vovchik
PS. I added the following routine to my HUG image demo and it works:
DECLARE FUNCTION MODFONT LIB "libgtk-x11-2.0.so.0" ALIAS "gtk_widget_modify_font" (w AS INTEGER, d AS INTEGER) AS VOID DECLARE FUNCTION PANGO LIB "libpango-1.0.so.0" ALIAS "pango_font_description_from_string" (s AS STRING) AS INTEGER DECLARE FUNCTION GETCHILD LIB "libgtk-x11-2.0.so.0" ALIAS "gtk_bin_get_child" (w AS INTEGER) AS INTEGER
' ------------------ SUB SETFONT(widget AS INTEGER, s AS STRING) ' ------------------ MODFONT(widget, PANGO(s)) END SUB
SETFONT(GETCHILD(but3), "Courier,Bold 15")
|
|