Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 30, 2012 2:15:43 GMT 1
For those BaCon users interested in using IUP for their GUI toolkit, I created a IUP GUI Designer for you. ;D ' BaCon GUI Designer
PRAGMA OPTIONS -I/usr/include/iup PRAGMA LDFLAGS iup PRAGMA INCLUDE iup.h PROTO IupClose
ok = IupOpen(NULL,NULL) ok = IupShow(IupLayoutDialog(NULL)) ok = IupMainLoop() IupClose()
jrs@laptop:~$ cd BaCon/B29 jrs@laptop:~/BaCon/B29$ ./bacon dlt.bac Converting 'dlt.bac'... done. Compiling 'dlt.bac'... done. Program 'dlt' ready. jrs@laptop:~/BaCon/B29$ ./dlt jrs@laptop:~/BaCon/B29$ ls -l dlt -rwxrwxr-x 1 jrs jrs 49789 Dec 29 17:05 dlt jrs@laptop:~/BaCon/B29$
|
|
|
Post by alexfish on Dec 30, 2012 11:53:53 GMT 1
Hi John Can get the dialog up but can't seem to add any widgets. after adding First nothing shows as a window the menu shows add child or brother, but get getting seg faults. ERROR: signal for SEGMENTATION FAULT received - memory invalid or array out of bounds? Try to compile the program with TRAP LOCAL to find the cause. are there any IUP files needed in the same local as the exec. or what do I do ? Regards Alex Attachments:
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 30, 2012 14:07:15 GMT 1
I was trying to be funny and posted the most minimalistic GUI designer possible. Try this. ' BaCon GUI Designer
PRAGMA OPTIONS -I/usr/include/iup PRAGMA LDFLAGS iup PRAGMA INCLUDE iup.h PROTO IupClose
ok = IupOpen(NULL,NULL) ok = IupShow(IupLayoutDialog(IupDialog(IupVbox(NULL)))) ok = IupMainLoop() IupClose()
The IUP dialog layout tool is a debugging feature and meant as a one line addition to your existing code to view and modify your design in real time. It can be used as a standalone GUI designer if you wish. It can export the C code for the layout to a file as well.
|
|
|
Post by alexfish on Dec 30, 2012 16:05:00 GMT 1
;D OK got the picture Also had a look at some of the Examples noticed a webbrowser.o , can you tell me more about this one BR Alex
|
|
|
Post by alexfish on Dec 30, 2012 17:03:35 GMT 1
Suppose First Thing first A BUTTON I am reading the iup.h as a reference for the widgets , it also gives a clue to the args Don't know if this is exactly correct for a button 'IupButton PRAGMA OPTIONS -I/IUP/iuplib/include ' BaCon GUI Designer PRAGMA LDFLAGS iup PRAGMA INCLUDE iup.h PROTO IupClose
ok = IupOpen(NULL,NULL) ok = IupShow(IupLayoutDialog(IupDialog(IupButton("But","1")))) ok = IupMainLoop() IupClose()
Attachments:
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 30, 2012 19:14:07 GMT 1
Alex, You should learn the IUP basics first then move on to more advanced forms of it's use. (combining functions) Here is a SB example that would be a good one to convert to BaCon/IUP to give you a better understanding how things work. Once it's working, stick in the dialog layout function using the main dialog handle as it's argument to view your application in the designer. John
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 31, 2012 2:09:11 GMT 1
I haven't tried IUP callbacks in BaCon yet so I thought I would give the SB button example I mentioned a try. PRAGMA OPTIONS -I/usr/include/iup PRAGMA LDFLAGS iup PRAGMA INCLUDE iup.h PROTO IupOpen IupSetAttributes IupAppend IupSetCallback IupShow IupMainLoop IupClose
DECLARE win TYPE Ihandle * DECLARE horzbox TYPE Ihandle * DECLARE btn1 TYPE Ihandle * DECLARE btn2 TYPE Ihandle * DECLARE btn3 TYPE Ihandle *
SUB Btn1_clicked PRINT "BUTTON 1 Event" END SUB
SUB Btn2_clicked PRINT "BUTTON 2 Event" END SUB
SUB Btn3_clicked PRINT "BUTTON 3 Event" END SUB
IupOpen(NULL,NULL) win = IupCreate("dialog") IupSetAttributes(win, "TITLE=\"Test Dialog\", SIZE=300x") horzbox = IupCreate("hbox") IupSetAttributes(horzbox, "GAP=5") btn1 = IupCreate("button") IupSetAttributes(btn1, "TITLE=Button1, EXPAND=HORIZONTAL") btn2 = IupCreate("button") IupSetAttributes(btn2, "TITLE=Button2, EXPAND=HORIZONTAL") btn3 = IupCreate("button") IupSetAttributes(btn3, "TITLE=Button3, EXPAND=HORIZONTAL") IupAppend(horzbox, btn1) IupAppend(horzbox, btn2) IupAppend(horzbox, btn3) IupAppend(win, horzbox) IupSetCallback(btn1, "ACTION", (Icallback)Btn1_clicked) IupSetCallback(btn2, "ACTION", (Icallback)Btn2_clicked) IupSetCallback(btn3, "ACTION", (Icallback)Btn3_clicked) IupShow(win) IupMainLoop() IupClose()
jrs@laptop:~/BaCon/B29$ ./bacon buttons.bac Converting 'buttons.bac'... done. Compiling 'buttons.bac'... done. Program 'buttons' ready. jrs@laptop:~/BaCon/B29$ ./buttons BUTTON 1 Event BUTTON 2 Event BUTTON 3 Event jrs@laptop:~/BaCon/B29$ What the sdbg remote debugger internal preprocessor is to ScriptBasic, the IupLayoutDialog() dialog layout tool is to IUP.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 31, 2012 21:31:02 GMT 1
|
|
|
Post by alexfish on Jan 1, 2013 5:20:07 GMT 1
Looks good . do the associated libs have to be on the system where the exec is installed, or if compiling the c code on another system. Though I would give an insight as what a .o file means , or is this stems from and age old language , this is one reason i hate c. well not so much hate it but here you will see some similarities . and reason for asking. download this file . also ensure you have FASM ,. installed , + gtk-devs , if using bacon + hug without problems, it should be ok. as with most things in Linux , extract the file , then cd to the folder , read the files which are going to be installed ,if happy enter a simple command. make then have a look what is there + the exec. JRS . I look forward at looking into IUP , the dialog.gui has some powerful features Regards Alex Attachments:
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 1, 2013 10:31:42 GMT 1
Alex,
I look forward to your review of IUP. The IUP project maintains a current set of binaries that cover most active OS platforms. With SB embedded applications you only need libscriba.so.
Peter's enhancements to BaCon to make using C libraries less of a PITA to work with and you don't have to predefine INT/LONG and STRINGS, keeps the language more traditional Basic like.
The rest of the BaCon power users have been silent for the most part about IUP and SB scripting and I would like to hear their input as well.
BTW The addition of the IUP Layout Tool checkbox was just for show and a hint for Peter to consider.
John
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 1, 2013 17:13:50 GMT 1
The addition of the IUP Layout Dialog checkbox feature looks like a simple change. All that Peter would have to do at conversion time is look for IupShow and make the following modification if the checkbox is enabled. Nothing else is needed. (PROTO/DECLARE/...) From: IupShow(win)
To: IupShow(IupLayoutDialog(win))
One might ask ... Q. What if there are multiple IupShow() functions? (multiple dialogs) A. If there are more than one IupShow() function in the program, modify the first one found and the user can chose the other dialogs from within the IUP layout tool. The other option is to use a NULL (empty dialog) for the layout tool handle and let the user select the dialog they wish to work with. Plan BDo nothing and let the IUP user put the statement where they want it.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 1, 2013 19:50:23 GMT 1
This is a IUP example of using some of the (Gtk wrapped native) controls. The FreeBASIC project has a IUP thread going that might be of some help.
|
|
|
Post by vovchik on Jan 1, 2013 22:49:49 GMT 1
Dear jrs, Interesting stuff. Keep at it With thanks and kind regards, vovchik
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 1, 2013 23:59:58 GMT 1
I hope I'm not stepping on any toes with the ScriptBasic embedding and IUP GUI toolkit threads. I started a BaCon/IUP and a BaCon Embedded Scripting thread on the All Basic forum for those interested in using IUP as their GUI toolkit verses HUG. I would also like to expand on using ScriptBasic as as an embedded scripting engine with BaCon applications. If you would like to join the AllBasic forum then send me (support@scriptbasic.org) an e-mail with your desired forum ID. If you can tell me what interests you most, I can focus on those areas.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 4, 2013 1:58:40 GMT 1
I was able to get the WebKit 1.0 IUP control working today. It seems there was a typo bug in the shared IUP object code. more ...
|
|