QB64 Phoenix Edition
Simple GUI - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: Chatting and Socializing (https://qb64phoenix.com/forum/forumdisplay.php?fid=11)
+--- Forum: General Discussion (https://qb64phoenix.com/forum/forumdisplay.php?fid=2)
+--- Thread: Simple GUI (/showthread.php?tid=281)

Pages: 1 2 3 4 5


RE: Simple GUI - Coolman - 06-10-2022

hello @RNBW. you don't have to apologize. maybe i wasn't clear enough when i posted about this lib. i examined the code before posting. it's entirely based on freebasic graphics commands. i had a little discussion with the author in the frebasic forum. he confirmed that he didn't have time to maintain this lib. if you want to see the discussion (last section) :

https://www.freebasic.net/forum/viewtopic.php?t=23202

about inform. it happens all the time in the forums that a post goes in another direction. it's not a big deal. i tested inform a long time ago under linux. it was complicated to make it work and i didn't like that it had to be installed in the root of the qb64 directory. I avoid this kind of lib because they are usually a source of instability. I tested it a little and uninstalled it. at the moment for qb64, I'm doing some research on raylib. we'll see what it gives.


RE: Simple GUI - RNBW - 06-10-2022

@Coolman
Interesting. We both corresponded with Lothar Schirm in your link above. I'd forgotten all about it. Old age!

I don't know what is happening about Inform because I couldn't find any links to download it in the QB Phoenix forum. I've recently purchased a new computer and I've not got Inform installed. I'll have to scratch around on my old computer and see if I can find a download file. Like you I don't think it is the answer for me.

I rarely work with Linux, so I'm really only interested in Windows. I think the lack of a professional looking GUI is holding back QB64. I must say when I look at a computer language I always first look to see if it has a GUI that I can try.

Also, when people use a computer program these days they expect to be looking at a modern screen.

When I am producing something I want others to see, I always program a GUI output, which means I use Freebasic or Purebasic, or something similar. If I want something that is QBasic compatible, I use QB64.

This is not intended to criticise the QB64 developers. They are doing a sterling job.


RE: Simple GUI - bplus - 06-10-2022

I am checking out SimpleGui6 from FB. It is not nearly as sophisticated as Fellippe's InForm for starters there is no Form designer and that is just for starters! Alas Fellippe needs to be around because people are going to get stuck with InForm. I get stuck when I try and remember the name of array holding text string from textboxes. For some reason Fellippe didn't do those like VB does as just another property?

But I will play around with it some more just for the challenge and the experience. It's just over 1300 LOC not bad. Already I see a property that takes an array, good thing I know how to handle that. Smile (Property is what VB called UDT elements.)


RE: Simple GUI - bplus - 06-10-2022

Eh! 2 Dim arrays in UDT and Functions that return UDT's, ha! I've had enough. Better to start from scratch.


RE: Simple GUI - Coolman - 06-10-2022

I don't see any interest in using inform. it seems that the author has abandoned it and won't provide support anymore. making a project with it would be very risky. that said, I looked at the license, it is possible to fork it without any problem.

concerning raylib, I found this link :

https://github.com/gAndy50/Qb64Wrappers

it doesn't work on linux. it's for windows. raylib works on freebasic and linux but it's not complete. the library is impressive. it has everything you need to have a professional quality gui.


RE: Simple GUI - bplus - 06-10-2022

I saw them talking about setting RayLib up for SmallBASIC (a Basic Interpreter). I didn't know it was GUI, I had it confabulated with RayTrace.


RE: Simple GUI - aurel - 06-10-2022

It looks that i need to repeat myself again

I am not insist on InForm at all

I was also thinking that Coolman talking about old Lotar SimpleGUI
if is true that SimpleGui is written with FB builtin commands to get GUI objects for Linux 
then fine ..maybe could be translated and i am interested of course .

I recently playing with BaCon HUG...which is GTK library wrapper ..or set of 
GTK functions used to Create GUI apps in BaCon ..
and is made in a simple way ..so i will see.


RE: Simple GUI - RNBW - 06-11-2022

Here are some images from Simple GUI for FreeBasic to give an idea of what can be achieved.  It provides just about everything that Inform does with the exception of a form designer.

Listbox
[Image: Listbox.jpg]

Code for Listbox:
Code: (Select All)
'===============================================================================
' GUI_Test_Listbox.bas
' Jan 17, 2015
' Latest revion November 28, 2016
'===============================================================================

#Include "GUI.bi"

Dim Shared As ListBox LB
Dim Shared As TextBox Text_Add, Text_index, Text_text
Dim Shared As Button Button_Add, Button_SetItem, Button_DeleteItem, Button_InsertItem, _
                            Button_Clear

Dim Shared As Integer index

Sub OpenWindow_Main()
'Window

    Dim As Integer i
    
    OpenWindow(400, 440, "Test Listbox")
    LB = ListBox_New(20, 20, 150, 400)
    Text_Add = TextBox_New(200, 50, 150, 20, "")
    Button_Add = Button_New(200, 80, 100, 20, "Add")
    Var Label_index = Label_New(200, 160, 150, 20, "Index:")
    Text_index    = TextBox_New(200, 180, 150, 20, "")
    Var Label_text = Label_New(200, 210, 150, 20, "Text:")
    Text_text = TextBox_New(200, 230, 150, 20, "")
    Button_SetItem = Button_New(200, 260, 100, 20, "Set Text")
    Button_DeleteItem = Button_New(200, 290, 100, 20, "Delete Item")
    Button_InsertItem = Button_New(200, 320, 100, 20, "Insert Item")
    
    Button_Clear = Button_New(200, 400, 150, 20, "Clear Listbox")
    
    For i = 0 To 20
        ListBox_Add(LB, "Item number: " + Str(i))
    Next
        
End Sub


Sub LB_EventHandler()
'Event handler of Listbox

    Dim As String text
    
    index = ListBox_GetIndex(LB)
    text = ListBox_GetItem(LB, index)
    TextBox_SetText(Text_index, Str(index))
    TextBox_SetText(Text_text, text)
    
End Sub
    
    
'Main:    

OpenWindow_Main()

Do
    If ListBox_Event(LB) Then LB_EventHandler()
    If TextBox_Event(Text_Add) Then TextBox_Edit(Text_Add)
    If Button_Event(Button_Add) Then ListBox_Add(LB, TextBox_GetText(Text_Add))
    If TextBox_Event(Text_text) Then TextBox_Edit(Text_text)
    If Button_Event(Button_SetItem) Then ListBox_SetItem(LB, index, TextBox_GetText(Text_text))
    If Button_Event(Button_DeleteItem) Then ListBox_DeleteItem(LB, index)
    If Button_Event(Button_InsertItem) Then _
        ListBox_InsertItem(LB, TextBox_GetText(Text_text), index)
    If Button_Event(Button_Clear) Then ListBox_Clear(LB)
Sleep 1
Loop Until Window_Event_Close

End

So the code is easy to write without a Form Designer.  I prefer Hungarian notation (ButtonEvent) rather than Button_Event and I would prefer to see Textbox rather than Textbox_New, but these are my own personal preferences and I won't be writing the library code.

@bplus has shown an interest (no pressure) and it would be great if an equivalent library could be produced for QB64.

Textbox
[Image: Textbox.jpg]


RE: Simple GUI - Coolman - 06-11-2022

it's an excellent little library with a definite advantage. no dependency. the only flaw I found with freebasic is the size of the display fonts which are too small and practically unreadable on my laptop with a display resolution of 1980x1080. i think qb64 handles the display fonts better.


RE: Simple GUI - RNBW - 06-11-2022

(06-11-2022, 03:24 PM)Coolman Wrote: it's an excellent little library with a definite advantage. no dependency. the only flaw I found with freebasic is the size of the display fonts which are too small and practically unreadable on my laptop with a display resolution of 1980x1080. i think qb64 handles the display fonts better.

I have the same resolution, but no problem.  If you have the display scale set up at 100%, the fonts are tiny and you need binoculars to read them  The recommended scale is 150% and the font size is fine.