{"id":16035240,"url":"https://github.com/fdesp87/winforms2gtk","last_synced_at":"2025-10-22T01:31:04.622Z","repository":{"id":58241926,"uuid":"512274210","full_name":"fdesp87/winforms2gtk","owner":"fdesp87","description":"This is a program to help the conversion of Visual Basic Microsoft Windows Forms to Glade,  the GTK User Interface Designer tool.","archived":false,"fork":false,"pushed_at":"2023-09-16T18:09:52.000Z","size":948,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-08T22:10:44.992Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ada","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fdesp87.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-09T19:57:01.000Z","updated_at":"2023-12-01T11:23:37.000Z","dependencies_parsed_at":"2024-10-08T22:10:24.681Z","dependency_job_id":"49350962-35bd-48fa-bfb5-e17c2dbcb811","html_url":"https://github.com/fdesp87/winforms2gtk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdesp87%2Fwinforms2gtk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdesp87%2Fwinforms2gtk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdesp87%2Fwinforms2gtk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdesp87%2Fwinforms2gtk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fdesp87","download_url":"https://codeload.github.com/fdesp87/winforms2gtk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237570886,"owners_count":19331713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-08T22:01:31.609Z","updated_at":"2025-10-22T01:30:59.104Z","avatar_url":"https://github.com/fdesp87.png","language":"Ada","readme":"# winforms2gtk (or in short w2gtk)\nwinforms2gtk, a program to help in the conversion of Windows Forms to Glade, the GTK UID\n========================================================================================\n\nThis is a program to help in the conversion of the User Interface (UI) of Visual Basic\nMicrosoft Windows Forms applications to Gtk and Ada.\n\nWindows provides Visual Studio as a Rapid Application Development tool including its \nUser Interface Designer. For each window, several files are produced, defining a \nWindows Form. \n\nCorrespondingly, Gtk also has a Rapid Application Development tool, called Glade.\n\nThe goal of winforms2gtk is to help in the translation of these files to Glade\nformat such that the output (a sort ov XML) can be used in GTK applications.\n\nNot only the glade file is produced but also several Ada files such as the gpr, the main window, \nthe widget collection, the signal callbacks and several enumerations files.\n\nThis is still an on-going project however it is gaining stability ans it is now usable.\n\nDependencies\n------------\n\nYou should have the following tools installed:\n\n- The GNAT Ada Compilation System, including GNAT Studio. Ada Core Technologies (ACT) \nCommunity editions are OK\n- GTK Libraries\n- Glade\n\n\nBuilding winforms2gtk\n---------------------\nOnce downloaded, just double-click on w2gtk.gpr and build it inside GNAT Studio.\n\nYou can change compilation/building options in w2gtk.gpr if you wish. Initially, the\nswitches are those used by ACT in their programs.\n\n\nUsing winforms2gtk\n------------------\nThe best way is to use a shell script to convert all windows forms of an application. Calling\nw2gtk can be as\n\nw2gtk -rp wpath -rf wfile -gp gpath -gf gfile -h --help -glade -dump -log -ap apath\n\nSwitches that are accepted by winforms2gtk:\n\n- -rp windows forms path\n- -rf windows forms name with no extension\n- -gp path where place the generated files\n- -gf name (with no extension) of the generated glade file\n- -ip path to icons\n- -glade generate the glade file\n- -ap path where to place the generated Ada files\n- -dump produce a dump of the windows and widgets\n- -log produce lots of messages when progressing in the translation\n- -h or --help help\n\nMechanics of the translation\n----------------------------\nA Windows Forms is described in three files:\n\n- The Designer file (ending in .Designer.vb)\n- The Resource file (ending in .resx)\n- The Visual Basic code (ending in .vb)\n\nw2gtk starts by parsing some parts of the Designer to identify windows and widgets. Then it\ncontinues by parsing the Resource file to get the majority of attributes or properties. It\ncomes back again to the Designer to complete the attributes and continues to partially parse\nthe Visual Basic code to identify the handlers.\n\nThen, w2gtk can generate, depending upon the switches:\n\n- a dump of the information (ending in .dump)\n- a log file (ending in .log)\n- the XML file (ending in .glade) containing the glade definition of the GTK windows and widgets\n- several Ada files to support the application\n\nNote that parsing of the three windows form files is no complete and may fail. It covers the most \nusual options only. A complete parser for these files is considered out-of-scope.\n\nFor the case of a top level window, w2gtk generates also the corresponding gpr file.\nA Windows' window is considered top level when it is resizable and not modal. In other case,\nit is considered a dialog.\n\nAlso note that, in general, it is usual in Windows Forms to employ relative position of \nelements in dialogs whilst GTK is more oriented to automatic placement by using boxes (although \nWindows has a control called FlowLayoutPanel that plays the same role).\nConverting relative position to automatic placement is not even attempted. Instead, \nan intermediate GTKFixed box is generated, where the Windows Forms elements are then placed \nusing the specific location and size.\n\nThe visual result is not always perfect. In the glade file generated by winforms2gtk you should \nfine-tune the positions to get a correct visual impression of the window. Sorry for that. Or even better, \nreplace the GtkFixed by automatic positioning Gtk Widgets such as GtkBox. Note in any case that converting \nFlowLayoutPanel to gtkbox is performed by w2gtk.\n\nCurrently the generated GTK top level windows are:\n\n- GtkWindow\n- GtkDialog\n- GtkFileChooserDialog\n- GtkFileFilter\n- GtkEntryBuffer\n- GtkListStore\n- GtkTreeStore\n- GtkImage\n- Cell Renderer\n\nAlso currently the generated GTK widgets are:\n\n- GtkLabel \n- GtkEntry\n- GtkComboTextBox (unsorted)\n- GtkButton (with possibly image)\n- GtkRadioButton  (with possibly image)\n- GtkCheckButton (with possibly image)\n- GtkToggleButton (with possibly image)\n- GtkImage \n- GtkSpinButton\n- GtkFrame\n- GtkBox\n- GtkToolTip \n- GtkCalendar\n- GtkColorButton\n- GtkListBox\n- GtkMenu and siblings\n- GtkToolBar and siblings\n- GtkNotebook\n- GtkTreeview and siblings\n- GtkStatusbar\n\nPending widgets:\n\n- GtkCombobox and sorted GtkComboTextBox\n\nOther Windows Forms elements are generated:\n\n- Date Picker\n- Time Picker\n\nIn addition, several Windows Forms elements are accepted however code is not generated:\n\n- PrintDocument\n- PrintDialog\n- FolderBrowserDialog\n\nand perphaps others\n\nThis is a work in progress. there are items pending to convert and also some of the\ngenerated widgets merit an improvement.\n\nThe generate the Ada files are:\n\n- a gpr (only for top level window)\n- a css (only for top level window) that can be used as template\n- the main window Ada file \n- the widget collection file within the window\n- the signal callbacks\n- the register signals Ada file\n- Ada enumerations (for gtkstores) file\n\nYou can then modify these files to build your application. No line of your code will be lost as\nw2gtk will include your modifications in the newly generated files by backing up, as a first step, your\nfiles to an increasing version using \"~\" and then using diff and patch. These backups files\nare kept as well the patch to facilitate manual checks of the inclusion.\n\nRecommendation:\n---------------\nBefore purging backup files, check that the .log for errors and if there are any,\nrecover your files from the backup and correct the errors.\n\nTesting\n-------\nTesting is performed by using the elements of an actual Windows application with about \n70 forms with the listed Windows elements.\n\nBug reports\n-----------\nPlease send questions and bug reports to the author. Of course, any help/contributions are\nwelcome.\n","funding_links":[],"categories":["Recently Updated","Applications"],"sub_categories":["[Oct 08, 2024](/content/2024/10/08/README.md)","Generators and Translators"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffdesp87%2Fwinforms2gtk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffdesp87%2Fwinforms2gtk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffdesp87%2Fwinforms2gtk/lists"}