|
Post by vovchik on Aug 14, 2014 10:41:38 GMT 1
Dear Joe and all, Here are three working examples of GOO and HUG3 - I also included 32-binaries compiled on Mint 16. The archive is large because there are images. My only problem is that radial fills for markup text don't seem to be working, but I am looking into that. With kind regards, vovchik
|
|
|
Post by vovchik on Aug 14, 2014 13:09:48 GMT 1
Dear all, Here is a hug3 version of the game fifteen - it amkes use of goocanvas, too. A Mint 32-bit binary is also in the archive, along with the source. Have fun. With kind regards, vovchik Attachments:fifteen.tar.gz (35.61 KB)
|
|
|
Post by bigbass on Aug 14, 2014 14:49:22 GMT 1
Hey vovchik
Great to see those apps will work with gtk3 and goo2!
My only problem is that radial fills for markup text don't seem to be working, but I am looking into that.
If you want to take a poke at it look here first (and or post the error report) look in the SUB INIT for commented out or new functions that replaced gtk2 with new functions for gtk3
some more stuff is depreciated also and instead of removing those lines I commented them out with '! that way I can go back and update those lines if needed
Do a search for '! in hug3 when something doesn't work and it did before in HUG
Thanks for the wonderful demos really pleased to see that we can still use gtk3 with all our older demos keeping them going by porting stuff a little at a time
Everything will be moving to gtk3 so the sooner we get started porting the better and easier it will be to see the needed changes
Joe
|
|
|
Post by vovchik on Aug 15, 2014 14:13:33 GMT 1
Dear Joe, This is a little demo of one method of filling a window with a background image in gtk3. It is PROTO at the moment but I think it might be nice to have the LAYOUT option for this purpose in hug3. What do you think? Source and a 32-bin Mint binary included. With kind regards, vovchik
|
|
|
Post by vovchik on Aug 16, 2014 15:39:18 GMT 1
Dear all, Here is a hug3 hypnotic animated spiral...and a 32-bit Mint binary. With kind regards, vovchik
|
|
|
Post by bigbass on Aug 16, 2014 17:21:33 GMT 1
Hey vovchik Thanks for more great demos! There is a lot of demo code that will find some new life I hate to see when there are major changes in libs and it kills already working code this happened to so many great gtk2 apps Its a long road still but we have some good progress just getting things to compile and run I missed out on the great goocanvas the first time around because I was so deep in porting gtk3/gdk stuff with PROTO but now all that work has helped to join some things together in the backend of HUG3 Joe
|
|
|
Post by bigbass on Aug 17, 2014 17:36:55 GMT 1
Hey vovchik & Alex GdkPixmap is obsolete now obsolete now also IMPORT "gdk_window_set_back_pixmap(long,long,int)" FROM HUGLIB$("gdk") TYPE void
we will use this instead gtk_css_provider_load_from_data Now we need to redo some code but I got a snippet working using gtk3 and css ! will port to HUG3 syntax This was some sticky code to remove a lot of casting but it is much cleaner now gtk3backimage.tar.gz (63.98 KB) Joe
|
|
|
Post by vovchik on Aug 17, 2014 19:22:03 GMT 1
Dear Joe, Thanks - it looks very good. I am trying to figure out how we can get those images - say, svgs - inline in the code, because it is then easy to modify them programatically for various purposes. Lots of good info here: css gtkWith kind regards, vovchik
|
|
|
Post by bigbass on Aug 18, 2014 3:44:44 GMT 1
Hey vovchik svg works here is a demo I did a theme to string thingy then load the string as an experimental test I know you are trying to do the in line idea but the syntax is very different now because we read css themes instead gtk3backimage2.tar.gz (10.29 KB) Joe
|
|
|
Post by vovchik on Aug 18, 2014 16:09:29 GMT 1
Dear Joe, Thanks for the svg example - I think I know how to handle that in inline fashion via CSS - using base64 - and will have to test. In the mean time, I have used your method for displaying background images also to change the color background. We are slowly making progress. Have a look... With kind regards, vovchik Attachments:back_color.tar.gz (6.98 KB)
|
|
|
Post by bigbass on Aug 18, 2014 16:23:55 GMT 1
Hey vovchik I was working on this when you posted we are on the same thought I think we will be able to do some nice stuff quickly Joe UPDATED just seen your code snippet with this wow gtk3 can parse the color$ impressive color$ = CONCAT$(" GtkWindow {\n", " background: ", color$, ";\n\n}") gtk_css_provider_load_from_data (provider, color$, -1, NULL)
' inline css to input text ' display an image background with gtk3 and css ' GdkPixmap is obsolete now
PRAGMA OPTIONS `pkg-config --cflags gtk+-3.0` PRAGMA LDFLAGS `pkg-config --libs gtk+-3.0` '--- Ported to bacon and modified by bigbass OPTION PARSE FALSE
'GtkWidget *window; DECLARE *window TYPE void
'-------- CSS ----------- 'GtkCssProvider *provider; 'GdkDisplay *display; 'GdkScreen *screen;
DECLARE provider TYPE void* DECLARE display TYPE void* DECLARE screen TYPE void*
CONST GTK_STYLE_PROVIDER_PRIORITY_FALLBACK = 1 CONST GTK_STYLE_PROVIDER_PRIORITY_THEME = 200 CONST GTK_STYLE_PROVIDER_PRIORITY_SETTINGS = 400 CONST GTK_STYLE_PROVIDER_PRIORITY_APPLICATION = 600 CONST GTK_STYLE_PROVIDER_PRIORITY_USER = 800 '------------------------
GTK_WINDOW_TOPLEVEL = 0
'========================================== SUB close_window (void) '========================================== gtk_main_quit () END SUB
gtk_init (0,0)
window = gtk_window_new (GTK_WINDOW_TOPLEVEL) gtk_window_set_default_size (window, 300, 300)
g_signal_connect_data(window, "delete-event", close_window, 0, 0, 0)
'---------------- CSS provider = gtk_css_provider_new () display = gdk_display_get_default () screen = gdk_display_get_default_screen (display)
gtk_style_context_add_provider_for_screen (screen, provider, \ GTK_STYLE_PROVIDER_PRIORITY_USER) '-- inline type coding is possible too yippie gtk_css_provider_load_from_data (provider, \ "GtkTextView {\n" \ "color: blue;\n" \ "font: Serif 38;\n" \ "background-color: yellow;\n" \ "-GtkWidget-cursor-color: red;\n" \ "}\n" \ "GtkTextView:selected {\n" \ "background-color: black;\n" \ "color: green;\n" \ "}\n", -1, NULL); g_object_unref (provider) '---------------------
tbuf = gtk_text_buffer_new (NULL) tview = gtk_text_view_new_with_buffer (tbuf)
gtk_container_add (window, tview) gtk_widget_show_all (window) gtk_main ()
|
|
|
Post by vovchik on Aug 19, 2014 13:44:47 GMT 1
Dear Joe (and all), Thanks for that. I have included two additional examples of background colors. One shows how you change the background color of widgets and the other how to include an inline svg in a container. With kind regards, vovchik UPDATED: Included an inline radial gradient SVG as background. We seem to be making progress.
|
|
|
Post by bigbass on Aug 19, 2014 16:28:36 GMT 1
Hey vovchik Great demos you posted! I must admit when I thought about porting to gtk3 I cringed at the thought about having to use css and figure out how to make it work the first working examples made it clear that this is the correct way to theme gtk will be a whole new world for HUG3 to make customized widgets but first lets get the ball rolling I like how gtk can parse the dollar sign without barfing using the official css is not a problem but I like how you showed this example of how to convert the svg (inline styled for bacon use) ball$ = CONCAT$("<svg height='32' width='32' opacity='0.95'>" \ "<radialGradient id='sballs'>" \ " <stop stop-color='red' offset='0'/>" \ " <stop stop-color='black' offset='1'/>" \ "</radialGradient>" \ "<g fill='url(#sballs)'>" \ "<ellipse cx='14' cy='14' rx='14' ry='14'/>" \ "</g>" \ "</svg>")
image = gtk_image_new_from_pixbuf(SVG_BUFF(ball$)) A few big hurdles were jumped Joe
|
|
|
Post by vovchik on Aug 19, 2014 22:04:40 GMT 1
Dear Joe and all, Thanks for the kind words. We wouldn't be getting far if it weren't for your exceptional efforts to port things to gtk3. Here is a rotating cube demo using hug3 and inline svgs. Let it run for about 40 seconds to see colors... With kind regards, Ps. Alex has also posed an elm-based cube demo today. Have a look, please. I am having trouble getting things to rotate but I think we are using different elm versions or I am using an older hug_elm.bac I will investigate, since elm is also fabulous, and Alex has done some great and groundbreaking work there. Attachments:cube.tar.gz (52.81 KB)
|
|
|
Post by alexfish on Aug 19, 2014 22:44:54 GMT 1
Hi Vovchik
The Cube Demo conversions from Gtk2 to Gtk3 is working fine
Was hunting hi and low for these bits today , Nice to see them back.
BR
Alex
|
|