|
Post by vovchik on May 17, 2020 21:25:16 GMT 1
Dear all, Here is a variation on the spin button - the graphic (svg) gets displayed with no file reads or writes - we use SVG_BUFF, a function that creates a pixbuf on the fly from an internal svg string. With kind regards, vovchik Attachments:
gtkspin2.bac.tar.gz (2.49 KB)
|
|
|
Post by bigbass on May 17, 2020 23:29:34 GMT 1
thanks vovchik for all you demos they show an easier way to use the properties and are clear to read I know a lot of experimentation is needed to get the syntax right
but the end result (once you see a reference demo) looks really good so keep up the great work!
And thanks Peter too for all your coding to bacon to make it flexible enough to try new ideas and all your demos and apps
and your constant improvements!
Joe
|
|
|
Post by vovchik on May 18, 2020 9:56:37 GMT 1
Dear Joe and Peter, Here is Peter's radio player with a bit of eye candy. I use SVG_BUFF to display the image, and it seems to be working nicely. I used today's fossil beta for compilation, and the popup works fine. With kind regards, vovchik
|
|
|
Post by Pjot on May 18, 2020 16:17:35 GMT 1
Thanks vovchik,
Works as it should!
BR Peter
|
|
|
Post by Pjot on May 23, 2020 13:01:17 GMT 1
All, After some investigation I found that the GUI approach in BaCon does theoretically fit. Basically, a Retained Mode GUI library is in fact a kind of state machine, consisting of a list of objects with properties. It is the library which maintains the state of the GUI, contrary to an Immediate Mode GUI library where the client program should maintain the state of the GUI (see for example the Nuklear port for BaCon). So when using libXt or GTK, we theoretically should be able to setup a GUI by creating widgets and setting properties. To demonstrate this point, I have updated the Internet Radio program for GTK in such a way that the 'gtk_widget_show_all' and 'gtk_widget_hide' functions can be defined by using GUISET and the "visible" property of the widget.
Regards Peter
|
|
|
Post by bigbass on May 23, 2020 15:54:58 GMT 1
Hello Peter works correctly on the RPI3 Thanks Joe I'm happy using gtk when using C (just to understand the needed connections) and also in the GUI you made which greatly simplifies the gtk code
|
|
|
Post by Pjot on May 23, 2020 18:26:19 GMT 1
Thanks for the logging Joe,
These warnings appear to be generated in case of 32bit systems, I have fixed the code so that they should not appear again.
BR Peter
|
|
|
Post by Pjot on May 24, 2020 17:54:34 GMT 1
All, Of course, the Xaw version of the Internet Radio could not stay behind. All versions are here now: - The BaCon Internet Radio program using Xaw
- The BaCon Internet Radio program using Motif
- The BaCon Internet Radio program using GTK3
Screenshot attached. BR Peter Attachments:
|
|
|
Post by bigbass on May 25, 2020 0:02:46 GMT 1
Hello Peter
very impressive three different languages doing the same thing but from one GUI parser ! and very quickly
this is an excellent way to see the differences in the code and do some heavy testing of your GUI parser we also get excellent demo code
Thanks also for looking into and fixing code for 32 bit systems gcc and clang now works correctly for the raspberry PI3
Joe
for Xaw on the RPI3 had to use this to compile
OPTION GUI TRUE PRAGMA GUI Xmu Xaw3d
|
|
|
Post by vovchik on May 25, 2020 9:38:15 GMT 1
Dear Joe and Peter, Here is a slightly expanded playlist - Peter and Joe formats included - I have a bit more classical, some tango, jazz and samba, and a bit of talk/news. With kind regards, vovchik Attachments:radio-stations.tar.gz (3.37 KB)
|
|
|
Post by vovchik on May 25, 2020 15:13:34 GMT 1
Dear all, Here is the latest gtk3 version - Peter's - with a bit of eye candy. With kind regards, vovchik
|
|
|
Post by Pjot on May 25, 2020 16:01:33 GMT 1
Thanks vovchik, Both for the radiostations and the eye candy! All works, but I'll leave the jazz-stuff out though, I not so much of a jazz fan Best regards Peter
|
|
|
Post by bigbass on May 25, 2020 17:39:08 GMT 1
Hello vovchik
Looks good compiles and runs correctly and the svg images don't take up so much vertical code space I like all styles of music just depends how I feel but for studying and coding something mellow in the background there is one I use called coffee jazz that doesn't distract me also the piano by Raul Di Blasio, Corazón de niño and anything else he plays
and the video Raúl Di Blasio y Richard Clayderman, Corazón de niño I saw him live in concert twice Joe
|
|
|
Post by Pjot on May 29, 2020 21:15:06 GMT 1
We still have the category of "helper-functions", most of which are showing and hiding actions, for which I have no better solution as of yet other than to use them directly in our code. Though theoretically we should be able to define our GUI in terms of widgets and properties, there still are helper functions which perform a lot of actions for us. The XtPopup function from libXt for example, performs more than 5 actions. And there are many other helper functions, like gtk_widget_hide, gtk_menu_popup_at_pointer, XmListAddItem etc which make life easy. We can use these functions now in a more BaCon friendly manner, using the widget/property approach. It works as follows: - Declare a function pointer to the function
- Use the new GUIFN to perform the action on the named widget
For example, the function 'gtk_widget_hide', declare a function pointer: DECLARE (*hide)() = gtk_widget_hide TYPE void
This will declare the function pointer 'hide' to the actual GTK function 'gtk_widget_hide'. We only have to do this one time. We can do this, for example, at the top of our program. Then we can use GUIFN to perform the action: CALL GUIFN(id, "input", hide)
This will now actually hide the widget known as "input" in our GUI identified by "id". To demonstrate this method, I have updated the GTK radio and also the Motif Radio programs. Advantages of this approach are: - Code now becomes easier on the eyes
- Code is compliant with the overall API design
- Code becomes smaller
- No need to cast widgets to a specific class (GTK)
- No need to worry about argument types
Of course, we can still use helper functions as-they-are in our program, but this new method makes GUI design a little easier (at least I hope so ) Latest in fossil, Regards Peter
|
|
|
Post by vovchik on May 29, 2020 21:47:08 GMT 1
Dear Peter, Thanks. Great idea. I will have to try it out soon (i.e. tonight). With kind regards, vovchik
|
|