wxbasic.sourceforge.net :: View topic - Gtkbasic-0.0.2

| wxbasic.sourceforge.net A discussion board for the wxBasic programming language.
FAQ Search Memberlist Usergroups
Profile You have no new messages Log out [ MarkUlrich ]
Gtkbasic-0.0.2
| wxbasic.sourceforge.net Forum Index -> Coding
View previous topic :: View next topic
Author | Message
--- | ---
MarkUlrich Joined: 03 Dec 2002 Posts: 436 Location: Karlsruhe, Germany |
Posted: Sat May 05, 2007 9:20 pm Post subject: Gtkbasic-0.0.2 |
"GINS (Gtk INterface for Script) is a way to add GTK interfaces to scrpit languages that doesn't have any GTK bindigs, like BASH scripts." http://freeweb.lombardiacom.it/kirsoft/gins.html I wrote wrappers to include it directly in Puppybasic as "native" functions. Details: http://www.murga-linux.com/puppy/viewtopic.php?p=114773#114773 If you would remove my "xwin"-functions from Puppybasic again, it might even compile in Windows. Gtk is available for Windows, e.g. for "WinGimp". But I did not try that yet. With ginsbasic you simply load a XML-file created with the Gui-designer "glade" in ginsbasic, and add some eventhandling. This makes development of grafical applications pretty simple The archive contains an example-calculator: Mark Last edited by MarkUlrich on Sat May 19, 2007 1:22 am; edited 1 time in total
Back to top |
MarkUlrich Joined: 03 Dec 2002 Posts: 436 Location: Karlsruhe, Germany |
Posted: Wed May 09, 2007 5:39 pm Post subject: q123ed |
At work I compiled the latest updated version in Windows using the Mingw compiler (msw, 2002 releases) with the latest gladewin32. I added some #ifdefs to exclude the xwin_ functions that rely on a Xserver. And I added a "gins_usleep()" to simulate xwin_usleep() in Windows. This modified code is not available for download yet. In ginsbasic I use "pthreads" to run the Gtk mainloop and the basic program simultaneously. As pthreads are based on Unix, I had to use an additional .dll to compile it. And it does not work yet. If I run my testprograms, the window appears, but gets "busy", and does not display the content. The basic-code continues to run though. If I modify gins.c to run the gtk-mainloop directly without threading, the full window displays correctly, but the gtkmainloop blocks further execution of the basic-code. I have no idea, if I will find a solution. This will make only slow progress, as I don't spend private time on the windows-port. I just do it in some spare free moments at work, as it could be used there to quickly build some small tools or prototypes. resources: http://gladewin32.sourceforge.net/modules/news/ http://sourceware.org/pthreads-win32/ http://www.mingw.org/ Mark
Back to top |
MarkUlrich Joined: 03 Dec 2002 Posts: 436 Location: Karlsruhe, Germany |
Posted: Thu May 10, 2007 8:42 pm Post subject: |
no success yet on the windows-version. I found out, that I do not rely on the pthreads library. It is just a tool for programmers, who want to write code in the Posix syntax. But you also can use a #ifdef to use the native systemcall CreateThread() in Windows. Unfortunatly, it leads to the same errors as described above. Some googling indicates, that Gtk has problems with the windows threads-implementation. Some workarounds were suggested, but my knowledge is not good enough, to implement them. I will use some more trial&error and googling on that issue in the next weeks. Mark
Back to top |
MarkUlrich Joined: 03 Dec 2002 Posts: 436 Location: Karlsruhe, Germany |
Posted: Fri May 11, 2007 10:06 pm Post subject: |
I updated the archive. This is for C coders only, some new, but unfinished things. Just a snapshot of the stuff I work on. Windows port still no change, but it is included now, though it is broken as described above. In the mingw console, type "make windows" to compile it. A binary "ginsbasic001.exe" is included. I also added a tool that I will use to add all those Gtk-functions to ginsbasic. It is not finished yet. ./_createfunctions.pb (or try in windows (I did not myself yet): ginsbasic001.exe createfunctions.pb ... no, will not work, I must replace the basefunctions.inc with the one of Puppybasic for windows. Have them at work, not here at home). You must edit it to set the folder, where the Gtk HTML-documentation is located. I uploaded the one I use: http://noforum.de/files/wxbasic/ginsbasic/ Attention, it is 44 MB extracted. It is the gtk-doc folder from gladewin mentioned above. Then ./_createfunctions.pb will output such stuff to the console:
Code:
sh-3.00# ./_createfunctions.pb void gtk_label_set_text GtkLabel const gchar *str void gtk_label_set_attributes GtkLabel PangoAttrList *attrs void gtk_label_set_markup GtkLabel const gchar *str void gtk_label_set_markup_with_mnemonic GtkLabel const gchar *str void gtk_label_set_pattern GtkLabel const gchar *pattern void gtk_label_set_justify GtkLabel void gtk_label_set_ellipsize GtkLabel PangoEllipsizeMode mode void gtk_label_set_width_chars GtkLabel gint n_chars void gtk_label_set_max_width_chars GtkLabel gint n_chars void gtk_label_get GtkLabel gchar **str guint gtk_label_parse_uline GtkLabel const gchar *string void gtk_label_set_line_wrap GtkLabel gboolean wrap void gtk_label_set_line_wrap_mode GtkLabel PangoWrapMode wrap_mode void gtk_label_get_layout_offsets GtkLabel gint *x gint *y guint gtk_label_get_mnemonic_keyval GtkLabel gboolean gtk_label_get_selectable GtkLabel const gchar* gtk_label_get_text GtkLabel void gtk_label_select_region GtkLabel gint start_offset gint end_offset void gtk_label_set_mnemonic_widget GtkLabel void gtk_label_set_selectable GtkLabel gboolean setting void gtk_label_set_text_with_mnemonic GtkLabel const gchar *str const gchar* gtk_label_get_label GtkLabel gboolean gtk_label_get_line_wrap GtkLabel gboolean gtk_label_get_selection_bounds GtkLabel gint *start gint *end gboolean gtk_label_get_use_markup GtkLabel gboolean gtk_label_get_use_underline GtkLabel gboolean gtk_label_get_single_line_mode GtkLabel gdouble gtk_label_get_angle GtkLabel const gchar *str void gtk_label_set_label GtkLabel const gchar *str void gtk_label_set_use_markup GtkLabel gboolean setting void gtk_label_set_use_underline GtkLabel gboolean setting void gtk_label_set_single_line_mode GtkLabel gboolean single_line_mode void gtk_label_set_angle GtkLabel gdouble angle sh-3.00#
So still work to be done, until it finally can generate valid C code for gins.c Mark
Back to top |
MarkUlrich Joined: 03 Dec 2002 Posts: 436 Location: Karlsruhe, Germany |
Posted: Sat May 19, 2007 1:28 am Post subject: |
I renamed the project to Gtkbasic. There seems to be no active project of that name, and I now added wrappers and some workarounds to access many objects. This is far from being finished, maybe 10-20% is done. But now my code-generator seems to work quite usable, so that I have to add only few handwritten exceptions. If that will be refined, I might be able to create huger bunches of code with the buildscript. My main goal currently are elements as they are used by GtkDialog or Xdialog, just with the difference, that you can modify them more detailed. So no Paint areas or image manipulation, but TextViews and Fileselectors. This will remain the target quite a while I fear, I'm just afraid to deal with the CLists I know them from Perl and C, and they are quite complex. Also adding Drag'n'Drop would be great, but this looks quite complex, too. I wrote tools for that as standalone-widgets in C for Puppylinux, and I'm not shure I can wrap all the required types and lists. Greets, Mark
Back to top |
David Cuny Site Admin Joined: 11 Aug 2002 Posts: 1422 Location: California |
Posted: Sat May 19, 2007 7:27 pm Post subject: |
There's nothing wrong with keeping the language small. wxBasic was originally intended to be a small wrapper around wxWidgets. In some ways, I still wish I had kept it that small.
Back to top |
Display posts from previous:
| wxbasic.sourceforge.net Forum Index -> Coding | All times are GMT
Page 1 of 1
Stop watching this topic |
Jump to:
You can post new topics in this forum You can reply to topics in this forum You can edit your posts in this forum You can delete your posts in this forum You can vote in polls in this forum You can moderate this forum
Powered by phpBB © 2001, 2005 phpBB Group