BASIC Studio for Linux (Cancelled)

User contributed sources that have become inactive, deprecated, or generally unusable. But ... we don't really want to throw them away either.
Post Reply
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: RAD for Linux

Post by caseih »

I don't think GTK devs or GTK users have any problems with GTK apps being written in other languages. Popular GTK apps include Geary (written in Vala), and Gnotes (written in C++).

So carry on.
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: RAD for Linux

Post by Munair »

GTK has a nice widget for tab panels, called notebook. I'm currently working on implementing it. The challenge is not to use deprecated GTK stuff and still create the proper effect, like widget borders etc... The screenshot shows the code that makes the widgets appear in the window.

Image

This will be the default code editor, but without code folding. Instead, identifiers will be in the left pane and selecting one will display the code. If this would be a window, then a second tab will show the form editor. To be continued...
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: RAD for Linux (in development)

Post by Munair »

There is a new dedicated website for the project where updates on the current status will be posted:

http://www.basicstudio.org/
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: RAD for Linux (in development)

Post by lizard »

Looks interesting as i am working in similar direction. This an unfinished test program:

Code: Select all

' Test-menu.bas

#DEFINE __FB_GTK3__
#include once "gtk/gtk.bi"

#define NULL 0

Declare Sub load_file_cb Cdecl()

Function button_press Cdecl( Byval widget As GtkWidget Ptr, Byval event As GdkEvent Ptr ) as integer
    If event->Type = GDK_BUTTON_PRESS Then
        Dim bevent As GdkEventButton Ptr
        bevent = cast(GdkEventButton Ptr, event)
        gtk_menu_popup (GTK_MENU (widget), NULL, NULL, NULL, NULL, bevent->button, bevent->Time)
        ' Tell calling code that we have handled this event  the buck stops here.
        Return TRUE
    Else
        ' Tell calling code that we have not handled this event  pass it on.
        Return FALSE
    End If
End Function

'' Callback for close button
sub on_button_clicked cdecl (byval button as GtkWidget ptr, byval buffer as GtkTextBuffer ptr)
  dim as GtkTextIter start, end_
  dim as gchar ptr text

  '' Obtain iters for the start and end of points of the buffer
  gtk_text_buffer_get_start_iter( buffer, @start )
  gtk_text_buffer_get_end_iter( buffer, @end_ )

  '' Get the entire buffer text.
  text = gtk_text_buffer_get_text( buffer, @start, @end_, FALSE )

  '' Print the text
  g_print( "%s", text )

  g_free( text )

  gtk_main_quit( )
end sub

'':::::
sub on_window_destroy cdecl (byval widget as GtkWidget ptr, byval userdata as gpointer)
  gtk_main_quit( )
end sub



' Print a string when a menu item is selected

Sub menuitem_response Cdecl( Byval stringa As gchar Ptr )
    g_print (!"%s\n", stringa)
End Sub

' Get the selected filename and print it to the console 
Sub file_ok_sel Cdecl ( Byval w As GtkWidget Ptr, Byval fs As GtkFileSelection Ptr) ', filew as G_OBJECT Ptr)
	Print *gtk_file_selection_get_filename (GTK_FILE_SELECTION (fs))
	'gtk_widget_destroy(filew)
End Sub

Sub import_file_cb Cdecl()
    Dim As GtkWidget Ptr filew
    ' Create a new file selection widget 
	filew = gtk_file_selection_new ("Import File Selection")
	
	g_signal_connect (G_OBJECT (filew), "destroy", G_CALLBACK (@gtk_main_quit), NULL)
	
	' Connect the ok_button to file_ok_sel function 
	g_signal_connect (G_OBJECT (GTK_FILE_SELECTION (filew)->ok_button), "clicked", G_CALLBACK (@file_ok_sel), filew)
	
	' Connect the cancel_button to destroy the widget 
	g_signal_connect_swapped (G_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button), "clicked", G_CALLBACK (@gtk_widget_destroy), G_OBJECT (filew))
	
	' Lets set the filename, as if this were a save dialog, and we are giving a default filename 
	gtk_file_selection_set_filename (GTK_FILE_SELECTION(filew),  "penguin.png")
	    
	gtk_widget_show (filew)
End Sub

Sub export_file_cb Cdecl()
    Dim As GtkWidget Ptr filew
    ' Create a new file selection widget 
	filew = gtk_file_selection_new ("Export File Selection")
	
	g_signal_connect (G_OBJECT (filew), "destroy", G_CALLBACK (@gtk_main_quit), NULL)
	
	' Connect the ok_button to file_ok_sel function 
	g_signal_connect (G_OBJECT (GTK_FILE_SELECTION (filew)->ok_button), "clicked", G_CALLBACK (@file_ok_sel), filew)
	
	' Connect the cancel_button to destroy the widget 
	g_signal_connect_swapped (G_OBJECT (GTK_FILE_SELECTION (filew)->cancel_button), "clicked", G_CALLBACK (@gtk_widget_destroy), G_OBJECT (filew))
	
	' Lets set the filename, as if this were a save dialog, and we are giving a default filename 
	gtk_file_selection_set_filename (GTK_FILE_SELECTION(filew),  "penguin.png")
	    
	gtk_widget_show (filew)
End Sub

Sub about_cb Cdecl()
    DIM AS GtkWidget PTR wina, framea, labela, labelb
    DIM AS         guint v1, v2, v3
    DIM AS        STRING GtkVersion
    
    ?"This code is compiled using headers for GTK " 
    ?GTK_MAJOR_VERSION & "." & GTK_MINOR_VERSION & "." &  GTK_MICRO_VERSION
    v1 =  4 : WHILE gtk_check_version_(v1, v2, v3) : v1 -= 1 : WEND
    v2 = 99 : WHILE gtk_check_version_(v1, v2, v3) : v2 -= 1 : WEND
    v3 = 44 : WHILE gtk_check_version_(v1, v2, v3) : v3 -= 1 : WEND
    GtkVersion = !"\n" & v1 & "." & v2 & "." & v3 & !"\n"

    wina = gtk_window_new (GTK_WINDOW_TOPLEVEL)
    g_signal_connect(G_OBJECT(wina), "destroy", _
    G_CALLBACK(@gtk_main_quit), NULL)
    g_signal_connect(G_OBJECT(wina), "key-press-event", _
    G_CALLBACK(@gtk_main_quit), NULL)
    
    gtk_window_set_title (GTK_WINDOW (wina), "About")
    gtk_container_set_border_width (GTK_CONTAINER (wina), 70)
    
    framea = gtk_frame_new (" Author: Lizard  Gtk running version is ")
    labelb = gtk_label_new (SADD(GtkVersion))
    gtk_container_add (GTK_CONTAINER (framea), labelb)
    gtk_container_add (GTK_CONTAINER (wina), framea)
    
    gtk_widget_show_all (wina)
End Sub

' Create the list of "messages"
Function create_list Cdecl( ) As GtkWidget Ptr

    Dim As GtkWidget Ptr scrolled_window
    Dim As GtkWidget Ptr tree_view
    Dim As GtkWidget Ptr model
    Dim As GtkTreeIter iter
    Dim As GtkCellRenderer Ptr cell
    Dim As GtkTreeViewColumn Ptr column
    Dim As integer i

    ' Create a new scrolled window, with scrollbars only if needed
    scrolled_window = gtk_scrolled_window_new (NULL, NULL)
    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC)

    model = cast(GtkWidget Ptr, gtk_list_store_new (1, G_TYPE_STRING))
    tree_view = gtk_tree_view_new ()
    gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window),  tree_view)
    gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), GTK_TREE_MODEL (model))
    gtk_widget_show (tree_view)

    ' Add some messages to the window
    For i = 0 To 9
        Dim As String msg
        msg = "Message #" + Str(i + 1)
        gtk_list_store_append (GTK_LIST_STORE (model), @iter)
        gtk_list_store_set (GTK_LIST_STORE (model),  @iter, 0, Strptr(msg), -1)
    Next i

    cell = gtk_cell_renderer_text_new ()

    column = gtk_tree_view_column_new_with_attributes ("Messages", cell, "text", 0, NULL)

    gtk_tree_view_append_column (GTK_TREE_VIEW (tree_view), GTK_TREE_VIEW_COLUMN (column))

    Return scrolled_window

End Function

' Add some text to text widget 
Sub insert_text Cdecl(Byval buffer As GtkTextBuffer Ptr)

    Dim As GtkTextIter iter
    Dim As Zstring * 1024 buf_text

    buf_text = !"From: pathfinder@nasa.gov\n"
    buf_text += !"To: mom@nasa.gov\n"
    buf_text += !"Subject: Made it!\n"
    buf_text += !"\n"
    buf_text += !"We just got in this morning. The weather has been\n"
    buf_text += !"great - clear but cold, and there are lots of fun sights.\n"
    buf_text += !"Sojourner says hi. See you soon.\n"
    buf_text += !" -Path\n"

    gtk_text_buffer_get_iter_at_offset (buffer, @iter, 0)
    gtk_text_buffer_insert (buffer, @iter,  buf_text, -1)
End Sub

' Create a scrolled text area that displays a "message"
Function create_text Cdecl( ) As GtkWidget Ptr

    Dim As GtkWidget Ptr scrolled_window
    Dim As GtkWidget Ptr  view_text
    Dim As GtkTextBuffer Ptr buffer

    view_text = gtk_text_view_new ()
    buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view_text))

    scrolled_window = gtk_scrolled_window_new (NULL, NULL)
    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC)

    gtk_container_add (GTK_CONTAINER (scrolled_window), view_text)
    insert_text (buffer)

    gtk_widget_show_all (scrolled_window)

    Return scrolled_window

End Function

Sub insert_text2 Cdecl(Byval buffer As GtkTextBuffer Ptr)

    Dim As GtkTextIter iter
    Dim As Zstring * 1024 buf_text

    buf_text = !"From: pathfinder@nasa.gov\n"
    buf_text += !"To: mom@nasa.gov\n"
    buf_text += !"Subject: Made it!\n"
    buf_text += !"\n"
    buf_text += !"We just got in this morning. The weather has been\n"
    buf_text += !"great - clear but cold, and there are lots of fun sights.\n"
    buf_text += !"Sojourner says hi. See you soon.\n"
    buf_text += !" -Path\n"

    gtk_text_buffer_get_iter_at_offset (buffer, @iter, 0)
    gtk_text_buffer_insert (buffer, @iter,  buf_text, -1)
End Sub

' Create a scrolled text area that displays a "message"
Function create_text2 Cdecl( ) As GtkWidget Ptr

    Dim As GtkWidget Ptr scrolled_window
    Dim As GtkWidget Ptr  view_text
    Dim As GtkTextBuffer Ptr buffer

    view_text = gtk_text_view_new ()
    buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view_text))

    scrolled_window = gtk_scrolled_window_new (NULL, NULL)
    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC)

    gtk_container_add (GTK_CONTAINER (scrolled_window), view_text)
    insert_text2 (buffer)

    gtk_widget_show_all (scrolled_window)

    Return scrolled_window

End Function

    Dim As GtkWidget Ptr win
    Dim As GtkWidget Ptr menu
    Dim As GtkWidget Ptr menu_bar
    Dim As GtkWidget Ptr datei_menu, bearbeiten_menu, optionen_menu, hilfe_menu
    Dim As GtkWidget Ptr menu_neu, menu_open, menu_import, menu_export, menu_druck, menu_exit
    Dim As GtkWidget Ptr menu_copy, menu_cut, menu_paste, menu_tier, menu_feld, menu_symbol
    Dim As GtkWidget Ptr menu_einstell, menu_doku, menu_kosmo, menu_uber
    Dim As GtkWidget Ptr vbox
    Dim As GtkWidget Ptr button
    Dim As String buf
    Dim As gint i
 
    'dim as GtkWidget ptr win2
  'dim as GtkWidget ptr vbox2
  'dim as GtkWidget ptr text_view
  'dim as GtkWidget ptr button2
  'dim as GtkTextBuffer ptr buffer
  
    gtk_init (NULL, NULL)

    ' create a new main window
    win = gtk_window_new (GTK_WINDOW_TOPLEVEL)
    gtk_window_set_title (GTK_WINDOW (win), "Sanskrit Workshop")
    gtk_widget_set_size_request (GTK_WIDGET (win), 1024, 768)
    gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_CENTER)
    g_signal_connect (G_OBJECT (win), "delete-event", G_CALLBACK (@gtk_main_quit), NULL)
                      
    ' datei
    menu = gtk_menu_new ()
    menu_neu = gtk_menu_item_new_with_label (Strptr("Neu"))
    gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_neu)
    g_signal_connect_swapped (G_OBJECT (menu_neu), "activate", G_CALLBACK (@menuitem_response),  g_strdup ("Neu"))
    gtk_widget_show (menu_neu)
    
    menu_open = gtk_menu_item_new_with_label (Strptr("Öffnen"))
    gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_open)
    g_signal_connect_swapped (G_OBJECT (menu_open), "activate", G_CALLBACK (@menuitem_response),  g_strdup ("Öffnen"))
    gtk_widget_show (menu_open)
    
    menu_import = gtk_menu_item_new_with_label (Strptr("Import"))
    gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_import)
    g_signal_connect_swapped (G_OBJECT (menu_import), "activate", G_CALLBACK (@import_file_cb),  g_strdup ("Import"))
    gtk_widget_show (menu_import)
    
    menu_export = gtk_menu_item_new_with_label (Strptr("Export"))
    gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_export)
    g_signal_connect_swapped (G_OBJECT (menu_export), "activate", G_CALLBACK (@export_file_cb),  g_strdup ("Export"))
    gtk_widget_show (menu_export)
    
    menu_druck = gtk_menu_item_new_with_label (Strptr("Drucken"))
    gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_druck)
    g_signal_connect_swapped (G_OBJECT (menu_druck), "activate", G_CALLBACK (@menuitem_response),  g_strdup ("Drucken"))
    gtk_widget_show (menu_druck)
    
    menu_exit = gtk_menu_item_new_with_label (Strptr("Beenden"))
    gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_exit)
    'g_signal_connect_swapped (G_OBJECT (menu_exit), "activate", G_CALLBACK (@menuitem_response),  g_strdup ("Beenden"))
   ' g_signal_connect_swapped (G_OBJECT(menu_exit), "activate", G_CALLBACK (@menuitem_response), NULL)
    g_signal_connect(G_OBJECT(menu_exit), "activate", G_CALLBACK(@gtk_main_quit), NULL)
    gtk_widget_show (menu_exit)
    
    datei_menu = gtk_menu_item_new_with_label ("Datei")
    gtk_widget_show (datei_menu)
    gtk_menu_item_set_submenu (GTK_MENU_ITEM (datei_menu), menu)
    
    ' bearbeiten
    menu = gtk_menu_new ()
    menu_neu = gtk_menu_item_new_with_label (Strptr("Kopieren"))
    gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_neu)
    g_signal_connect_swapped (G_OBJECT (menu_neu), "activate", G_CALLBACK (@menuitem_response),  g_strdup ("Kopieren"))
    gtk_widget_show (menu_neu)
    
    menu_open = gtk_menu_item_new_with_label (Strptr("Ausschneiden"))
    gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_open)
    g_signal_connect_swapped (G_OBJECT (menu_open), "activate", G_CALLBACK (@menuitem_response),  g_strdup ("Ausschneiden"))
    gtk_widget_show (menu_open)
    
    menu_exit = gtk_menu_item_new_with_label (Strptr("Einfügen"))
    gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_exit)
    g_signal_connect_swapped (G_OBJECT (menu_exit), "activate", G_CALLBACK (@menuitem_response),  g_strdup ("Einfügen"))
    gtk_widget_show (menu_exit)
    
    bearbeiten_menu = gtk_menu_item_new_with_label ("Bearbeiten")
    gtk_widget_show (bearbeiten_menu)
    gtk_menu_item_set_submenu (GTK_MENU_ITEM (bearbeiten_menu), menu)
    
    ' hilfe
    menu = gtk_menu_new ()
    menu_doku = gtk_menu_item_new_with_label (Strptr("Dokumentation"))
    gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_doku)
    g_signal_connect_swapped (G_OBJECT (menu_doku), "activate", G_CALLBACK (@menuitem_response),  g_strdup ("Dokumentation"))
    gtk_widget_show (menu_doku)
   
    
    menu_uber = gtk_menu_item_new_with_label (Strptr("Über"))
    gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_uber)
    g_signal_connect_swapped (G_OBJECT (menu_uber), "activate", G_CALLBACK (@about_cb),  g_strdup ("Über"))
    gtk_widget_show (menu_uber)
    
    hilfe_menu = gtk_menu_item_new_with_label ("Hilfe")
    gtk_widget_show (hilfe_menu)
    gtk_menu_item_set_submenu (GTK_MENU_ITEM (hilfe_menu), menu)
    
    
    
    ' A vbox to put a menu and a button in:
    vbox = gtk_vbox_new (FALSE, 0)
    gtk_container_add (GTK_CONTAINER (win), vbox)
    gtk_widget_show (vbox)

    ' Create a menu-bar to hold the menus and add it to our main window
    menu_bar = gtk_menu_bar_new ()
    gtk_box_pack_start (GTK_BOX (vbox), menu_bar, FALSE, FALSE, 2)
    gtk_widget_show (menu_bar)
    
    ' And finally we append the menu-item to the menu-bar
    gtk_menu_shell_append (GTK_MENU_SHELL (menu_bar), datei_menu)
    gtk_menu_shell_append (GTK_MENU_SHELL (menu_bar), bearbeiten_menu)
    gtk_menu_shell_append (GTK_MENU_SHELL (menu_bar), hilfe_menu)
    
  '  Dim As GtkWidget Ptr win
    Dim As GtkWidget Ptr vpaned
    Dim As GtkWidget Ptr list
    Dim As GtkWidget Ptr text

    gtk_init (NULL, NULL)

    gtk_widget_set_size_request (GTK_WIDGET (win), 640, 480)

    ' create a vpaned widget and add it to our toplevel window
    vpaned = gtk_vpaned_new ()
    gtk_container_add (GTK_CONTAINER (win), vpaned)
    gtk_widget_show (vpaned)
    gtk_box_pack_end (GTK_BOX (vbox),vpaned, TRUE, TRUE, 2)
    
    text = create_text ()
    gtk_paned_pack1 (GTK_PANED (vpaned), text,1,1)
    gtk_widget_show (text)

    text = create_text2 ()
    gtk_paned_pack2 (GTK_PANED (vpaned), text,1,1)
    gtk_widget_show (text)
   
    gtk_widget_show (win)

    gtk_main ()

    End 0
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: RAD for Linux (in development)

Post by Munair »

Looking at your code, the major difference with this project is OOP. Defining a menu and calling handlers is done by objects:

Code: Select all

'{MENU BAR}
	
	MenuBar1.Form = @this
	MenuBar1.ParentBox = @LayoutBox1
	MenuBar1.Create()
	
	'{MENU ITEM 1}
	MenuItem1.ParentWidget = @MenuBar1
	MenuItem1.ParentMenu = true
	MenuItem1.Caption = "File"
	MenuItem1.Create()
	
	'{SUBMENU ITEM 1 OF MENU ITEM 1}
	SubMenuItem1.Caption = "New..."
	SubMenuItem1.ParentWidget = @MenuItem1.PopupWidget
	SubMenuItem1.ClickHandler = @submenuitem1_clickhandler_()
	SubMenuItem1.Create()
	'{SUBMENU ITEM 2 OF MENU ITEM 1}
	SubMenuItem2.Caption = "Open..."
	SubMenuItem2.ClickHandler = @submenuitem2_clickhandler_()
	SubMenuItem2.ParentWidget = @MenuItem1.PopupWidget
	SubMenuItem2.Create()
	'{SUBMENU ITEM 3 OF MENU ITEM 1}
	SubMenuItem3.Caption = "Save as..."
	SubMenuItem3.ClickHandler = @submenuitem3_clickhandler_()
	SubMenuItem3.ParentWidget = @MenuItem1.PopupWidget
	SubMenuItem3.Create()
	'{SUBMENU ITEM 4 OF MENU ITEM 1}
	SubMenuItem4.Caption = "Quit"
	SubMenuItem4.ClickHandler = @submenuitem4_clickhandler_()
	SubMenuItem4.ParentWidget = @MenuItem1.PopupWidget
	SubMenuItem4.Create()
The Create() routine would then look like this:

Code: Select all

sub fxTMenuItem.Create()
	Handle = gtk_menu_item_new_with_label(caption_)
	gtk_menu_shell_append(GTK_MENU_SHELL(ParentWidget->Handle), Handle)
	if parentmenu_ then
		' add menu
		PopupWidget.Handle = gtk_menu_new()
		gtk_menu_item_set_submenu(GTK_MENU_ITEM(Handle), PopupWidget.Handle)
	else
		' menuitem handler
		if clickhandler_ <> Nil then
			g_signal_connect_swapped(G_OBJECT(Handle), fxKSignalActivate, _
				G_CALLBACK(clickhandler_), NULL)
		end if
	end if
end sub
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: RAD for Linux (in development)

Post by lizard »

If i understood right, you want to create a rad-system with your own oop-hierarchy (linux only). Why not using the predefined oop of Gtk for both, Linux and Windows?
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: RAD for Linux (in development)

Post by Munair »

lizard wrote:If i understood right, you want to create a rad-system with your own oop-hierarchy (linux only). Why not using the predefined oop of Gtk for both, Linux and Windows?
I do not want to expose GTK to the source code. First, for the user everything will be native FB, which would be great. Having to dive into GTK isn't funny and most likely discouraging. Second, if at one point it is decided to go multiplatform and use other libraries, like Qt, a common OO framework (BSCL) already exists.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: RAD for Linux (in development)

Post by lizard »

Munair wrote:Having to dive into GTK isn't funny and most likely discouraging.
In my unstanding a RAD is a designer where one can design forms with widgets and exports source code, where it is possible to add further improvements. Like i did with wx-c. For Gtk there it was possible with Glade 2 under Windows to produce such a Gtk-code.
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: RAD for Linux (in development)

Post by Munair »

lizard wrote:
Munair wrote:Having to dive into GTK isn't funny and most likely discouraging.
In my unstanding a RAD is a designer where one can design forms with widgets and exports source code, where it is possible to add further improvements. Like i did with wx-c. For Gtk there it was possible with Glade 2 under Windows to produce such a Gtk-code.
A full RAD has a designer and code editor so one can design forms and write user events from the same interface. There shouldn't be the need to export the design in order to develop the program further. Also, it should be possible to adjust the design and rename objects etc afterwards, which usually fails when exported code is edited outside of form designer-only environment.

Take a look at Lazarus (FreePascal) or the old REALbasic interface (now Xojo), or VisualBasic for that matter. In contrast, a Glade-like workflow is not appealing and isn't RAD strictly speaking. REALbasic in particular was quite appealing to both professional and hobbyist programmers because it allowed for really fast and comfortable development. Using a Glade-like system undermines that work-flow. I never used that kind of system. PureBasic uses the same kind of system and it has never become very popular even though it is multi-platform.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: RAD for Linux (in development)

Post by marcov »

lizard wrote:
Munair wrote:Having to dive into GTK isn't funny and most likely discouraging.
In my unstanding a RAD is a designer where one can design forms with widgets and exports source code
No that is a standalone designer. A RAD allows to work with code and designer seamlessly and often has 4GL aspects like doing entire databinding of databases in the designer, SQL and all, dragging on database connections, transactions, queries, webservers, timers, comports etc. Many can even show live db data in the designer.

To that matter, most RADs generate a streamed representation of the form hierarchy to be loaded runtime. Doing it in resourcefiles or -dlls allows to rearrange the GUI visually a bit without recompilation (Limited rearrangements, mostly meant to move or enlarge labels when later translation has too little room).

There are RADs that generate sourcecode (and thus continuously have to rescan it to synchronize it with the designer/form state) though quite often for standardized languages that can't be extended to make the easy way work (like many Java Rads of the early 2000s), but they are usually less stable, and more limited, simply because the code parsing is hard. The designer might not recognize its generated code anymore after alteration by the user. I do think it is possible to get very far this way too, but it is horribly, horribly expensive and difficult to get to a certain acceptable level (and it needn't be)

And like Munair says (our posts crossed a bit), the state of the GTK Designers is not really considered the pinnacle of RAD. By anyone :-)

In a similar discussion, TJF once argued that GTK has some ways to load XML representations of forms runtime though, that could be worth investigating, though I can't remember if that also took care of event coupling.

The ties of the formdata to the code are the problem, and are often done by introspection/rtti. In e.g. Delphi the created components are assigned to their declarations inside the form class (for easier handling in the handlers) and the event handlers in the streamed representation are resolved to code. Both require RTTI.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: RAD for Linux (in development)

Post by lizard »

Munair wrote:A full RAD has a designer and code editor so one can design forms and write user events from the same interface. There shouldn't be the need to export the design in order to develop the program further.
Once the user has the code for the skeleton program he can improve it further wherever he wants, even in a simple texteditor. Then he can concentrate on the contents of his program without any unnessary complications. Thats what i like on FreeBasic :-)
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: RAD for Linux (in development)

Post by marcov »

lizard wrote:
Munair wrote:A full RAD has a designer and code editor so one can design forms and write user events from the same interface. There shouldn't be the need to export the design in order to develop the program further.
Once the user has the code for the skeleton program he can improve it further wherever he wants, even in a simple texteditor. Then he can concentrate on the contents of his program without any unnessary complications. Thats what i like on FreeBasic :-)
Programs are rarely created and then finished on one go using top down development. In a normal situation there are continuous requests for alterations and enhancements that also touch the GUI. That doesn't mean however that the RAD principle is a natural fit for all applications. But it can be a real timesaver for the ones that do.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: RAD for Linux (in development)

Post by lizard »

Last year i worked with c on windows. There are several gui-designers like Visual mingw studio and others, all similar like fbedit. They produce .rc and .res files. Then i started with FreeBasic. Here i found Firefly and FreeQIDE. It works with RapidQ, which is oop, could be of interest here:

https://www.freebasic-portal.de/downloa ... a-159.html

It was done years before, but abanonded, then almost forgotten. Source is available, too. If you look at the RapidQ designer, there are more widgets then in all other designers.
lizard
Posts: 440
Joined: Oct 17, 2017 11:35
Location: Germany

Re: RAD for Linux (in development)

Post by lizard »

Funny, can it be this is the origin realbasic is based on?

Code: Select all

Release Version 1.15
8/11/2013

This is a text integrated developer environment (IDE) for the
RapidQ compiler (c) William Yu and RealBasic (C)
Munair
Posts: 1286
Joined: Oct 19, 2017 15:00
Location: Netherlands
Contact:

Re: RAD for Linux (in development)

Post by Munair »

lizard wrote:Funny, can it be this is the origin realbasic is based on?

Code: Select all

Release Version 1.15
8/11/2013

This is a text integrated developer environment (IDE) for the
RapidQ compiler (c) William Yu and RealBasic (C)
RapidQ? No. The roots of the REALbasic compiler are in CrossBasic, written by Adrew Barry.
Post Reply