|
Post by vovchik on Mar 15, 2014 10:05:45 GMT 1
Dear guys,
I am getting somewhere. Here is the code for a child transparent popup GTK window. I compiled it using BaCon 2.4 (had as yet unresolved issues with 2.5 beta). Now just to do the pixbuf svg stuff - pretty easy - and we have it.
' ***************************************************** ' PROGRAM: rgbawin.bac ' PURPOSE: demo a transparent popup gtk window ' AUTHOR: vovchik (Puppy Linux forum) ' MODDED: ' DEPENDS: gcc, bacon, bash ' PLATFORM: Puppy Linux (actually, any *nix) ' DATE: 15-03-2014 ' NOTES: Use BaCon 2.4 ' LICENSE: GPL3 ' *****************************************************
' *********************** ' COMPILER DIRECTIVES ' ***********************
PRAGMA LDFLAGS pkg-config --cflags --libs gtk+-2.0 PRAGMA INCLUDE cairo/cairo.h PRAGMA INCLUDE gtk-2.0/gtk/gtk.h PRAGMA INCLUDE gtk-2.0/gdk/gdk.h
' *********************** ' END COMPILER DIRECTIVES ' ***********************
' *********************** ' EXTERNAL FUNCTIONS ' ***********************
PROTO gtk_container_add PROTO gtk_init PROTO gtk_label_set_label PROTO gtk_label_set_use_markup PROTO gtk_main ALIAS DISPLAY PROTO gtk_widget_realize PROTO gtk_widget_set_app_paintable PROTO gtk_widget_set_colormap PROTO gtk_widget_show_all PROTO gtk_window_move PROTO gtk_window_set_destroy_with_parent PROTO gtk_window_set_title PROTO gtk_window_set_transient_for PROTO gtk_label_new PROTO gtk_widget_get_screen PROTO gtk_window_new PROTO gdk_cairo_region PROTO gdk_window_set_back_pixmap PROTO gdk_cairo_create PROTO gtk_main_quit PROTO gtk_label_set_justify PROTO g_signal_connect PROTO g_signal_connect_data PROTO cairo_clip PROTO cairo_set_operator PROTO cairo_set_source_rgba PROTO cairo_paint PROTO cairo_destroy
' *********************** ' END EXTERNAL FUNCTIONS ' ***********************
' *********************** ' SUBS & FUNCTIONS ' ***********************
' ------------------ SUB EXIT_PROG() ' ------------------ gtk_main_quit() END SUB
' ------------------ SUB HANDLE_EXPOSE(GtkWidget* widget, GdkEventExpose* event) ' ------------------ LOCAL cr TYPE cairo_t* LOCAL region ' Create cairo context cr = gdk_cairo_create(GDK_DRAWABLE(widget->window)) gdk_cairo_region(cr, event->region) cairo_clip(cr) ' Draw alpha background cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE) cairo_set_source_rgba(cr, 0.5, 0.5, 0.5, 0.0) cairo_paint(cr) ' Free context cairo_destroy(cr) END SUB
' ------------------ SUB MK_GUI() ' ------------------ LOCAL mainwin TYPE GtkWidget* LOCAL win TYPE GtkWidget* LOCAL label_popup TYPE GtkWidget* LOCAL label_main TYPE GtkWidget* LOCAL screen TYPE GdkScreen* LOCAL l1$, l2$ TYPE STRING l1$ = "This is the main window,\n" \ "which is pretty standard.\n" \ "It has a child popup that\n" \ "is transparent." l2$ = "<span color='red' font='Sans Bold 35'><b>" \ "This is an RGBA window.\n" \ "<span color='dimgray'>It is pretty groovy!</span>" \ "</b></span>" gtk_init(0, 0) mainwin = gtk_window_new(GTK_WINDOW_TOPLEVEL) gtk_window_set_title (GTK_WINDOW(mainwin), "RGBA Win") gtk_widget_show_all(mainwin) label_main = gtk_label_new(NULL) gtk_label_set_label(GTK_LABEL(label_main), l1$) gtk_container_add(GTK_CONTAINER(mainwin), label_main) gtk_widget_show_all(GTK_WIDGET(mainwin)) win = gtk_window_new(GTK_WINDOW_POPUP) screen = gtk_widget_get_screen(win) gtk_widget_set_colormap(win, gdk_screen_get_rgba_colormap(screen)) gtk_widget_set_app_paintable(win, TRUE) gtk_widget_realize(win) gdk_window_set_back_pixmap(win->window, NULL, FALSE) gtk_window_set_transient_for(GTK_WINDOW(win), GTK_WINDOW(mainwin)) gtk_window_set_destroy_with_parent(GTK_WINDOW(win), TRUE) gtk_window_move(GTK_WINDOW(win), 200, 300) label_popup = gtk_label_new(NULL) gtk_label_set_justify(GTK_LABEL(label_popup), GTK_JUSTIFY_CENTER) gtk_label_set_use_markup(GTK_LABEL(label_popup), TRUE) gtk_label_set_label(GTK_LABEL(label_popup), l2$ ) gtk_container_add(GTK_CONTAINER(win), label_popup) g_signal_connect(win, "expose-event", G_CALLBACK(HANDLE_EXPOSE), win) g_signal_connect_data(mainwin, "delete-event", EXIT_PROG, 0, 0, 0) gtk_widget_show_all(win) END SUB
' *********************** ' END SUBS & FUNCTIONS ' ***********************
' *********************** ' MAIN ' ***********************
MK_GUI() DISPLAY()
' *********************** ' END MAIN ' ***********************
With kind regards, vovchik
|
|
|
Post by Pjot on Mar 15, 2014 13:38:03 GMT 1
Hi vovchik,
Compilation in 2.5 beta works with the correct PRAGMA settings:
PRAGMA LDFLAGS `pkg-config --libs gtk+-2.0` PRAGMA OPTIONS `pkg-config --cflags gtk+-2.0` PRAGMA INCLUDE cairo.h gtk/gtk.h gdk/gdk.h
The new compile scheme creates a Makefile, which separates linker flags from compile options. This is to ensure compatibility with older GCC versions like the one which comes with Redhat 5.x.
BR, Peter
|
|
|
Post by vovchik on Mar 15, 2014 15:39:57 GMT 1
Dear Peter, Thanks. It works nicely now in 2.5.5 beta with your PRAGMA lines. With kind regards, vovchik
|
|
|
Post by bigbass on Mar 15, 2014 16:16:06 GMT 1
Hey vovchik Works correctly on my new install Glad to see you got it ported and sorted and you can add all the goodies to it now from the other popup windows you did before I like the term You used once before language enrichment Just being able to solve problems many different ways but in the end it all compiles on BaCon A reminder we need this as a dependency apt-get install libgtk2.0-dev P.S Thanks Peter for the new PRAGMA example for the compile line That will be used in the new beta will test and offer feedback Joe
|
|
|
Post by konaexpress on Mar 15, 2014 16:29:35 GMT 1
Please post screen shots when you guys can.
John
|
|
|
Post by vovchik on Mar 15, 2014 18:25:34 GMT 1
Dear John, Here is a screenshot. The red and grey text comes up in a "windowless" popup and is visible on all workspaces. My next task is to integrate the nice SVG and to display that instead of just text. With kind regards, vovchik Attachments:
|
|
|
Post by konaexpress on Mar 15, 2014 18:34:21 GMT 1
Looking good!
John
|
|
|
Post by vovchik on Mar 16, 2014 11:48:01 GMT 1
Dear guys, This is another variation on the same theme, but a widget attached (slider), to the transparent window with which you can control the opacity. If you click on the rectangle, you can toggle window decorationsso that you can exit the program cleanly. Have fun!. ' ***************************************************** ' PROGRAM: proto_alphademo1.bac ' PURPOSE: demo a transparent gtk window ' with widgets ' AUTHOR: vovchik(Puppy Linux forum) ' MODDED: ' DEPENDS: gcc, bacon, bash ' PLATFORM: Puppy Linux(actually, any *nix) ' DATE: 15-03-2014 ' NOTES: Original by Mike: http://plan99.net/~mike/blog ' Slidebar by Fred Morcos: http://fredmorcos.blogspot.com/ ' LICENSE: GPL3 ' *****************************************************
' *********************** ' COMPILER DIRECTIVES ' ***********************
' for 2.4 'PRAGMA LDFLAGS pkg-config --cflags --libs gtk+-2.0 'PRAGMA INCLUDE cairo/cairo.h 'PRAGMA INCLUDE gtk-2.0/gtk/gtk.h 'PRAGMA INCLUDE gtk-2.0/gdk/gdk.h ' for 2.5 PRAGMA LDFLAGS `pkg-config --libs gtk+-2.0` PRAGMA OPTIONS `pkg-config --cflags gtk+-2.0` PRAGMA INCLUDE cairo.h gtk/gtk.h gdk/gdk.h
' *********************** ' END COMPILER DIRECTIVES ' ***********************
' *********************** ' EXTERNAL FUNCTIONS ' ***********************
PROTO gtk_container_add PROTO gtk_hscale_new_with_range PROTO gtk_init PROTO gtk_main ALIAS DISPLAY PROTO gtk_main_quit PROTO gtk_range_set_update_policy PROTO gtk_range_set_value PROTO gtk_table_attach PROTO gtk_table_new PROTO gtk_widget_add_events PROTO gtk_widget_get_screen PROTO gtk_window_new PROTO gtk_widget_queue_draw PROTO gtk_window_resize PROTO gtk_widget_set_app_paintable PROTO gtk_widget_set_colormap PROTO gtk_widget_show_all PROTO gtk_window_get_size PROTO gtk_window_set_decorated PROTO gtk_window_set_position PROTO gtk_window_set_title ' gdk PROTO gdk_cairo_create PROTO gdk_screen_get_rgb_colormap PROTO gdk_screen_get_rgba_colormap ' cairo PROTO cairo_destroy PROTO cairo_fill PROTO cairo_paint PROTO cairo_rectangle PROTO cairo_set_source_rgba PROTO cairo_set_source_rgb PROTO cairo_set_operator PROTO cairo_stroke ' gobject PROTO g_signal_connect PROTO g_signal_connect_data
' *********************** ' END EXTERNAL FUNCTIONS ' ***********************
' *********************** ' INITIALIZATION ' ***********************
DECLARE alpha_value TYPE double DECLARE window TYPE GtkWidget* DECLARE table TYPE GtkWidget* DECLARE slider TYPE GtkWidget*
' *********************** ' END INITIALIZATION ' ***********************
' *********************** ' SUBS & FUNCTIONS ' ***********************
' ------------------ SUB EXIT_PROG() ' ------------------ gtk_main_quit() END SUB
' ------------------ SUB SLIDER_VALUE_CHANGED(GtkRange *range, GtkScrollType scroll, gdouble value, gpointer user_data) ' ------------------ ' called whenever the slider is moved; in turn, it calls ' gtk_widget_queue_draw() to redraw the window with the new rect alpha_value = value / 100.0 gtk_widget_queue_draw(window) END SUB
' ------------------ SUB SCREEN_CHANGED(GtkWidget *widget, GdkScreen *old_screen, gpointer userdata) ' ------------------ ' only some X servers support alpha channels, so always have a fallback LOCAL supports_alpha TYPE int LOCAL screen TYPE GdkScreen* LOCAL colormap TYPE GdkColormap* supports_alpha = FALSE ' check whether display supports alpha channels; get colormap screen = gtk_widget_get_screen(widget) colormap = gdk_screen_get_rgba_colormap(screen) IF ISFALSE(colormap) THEN PRINT "Your screen does not support alpha channels!" colormap = gdk_screen_get_rgb_colormap(screen) supports_alpha = FALSE ELSE PRINT "Your screen supports alpha channels!" supports_alpha = TRUE END IF ' now that we have a colormap appropriate for the screen, use it gtk_widget_set_colormap(widget, colormap) END SUB
' ------------------ SUB EXPOSE(GtkWidget *widget, GdkEventExpose *event, gpointer userdata) ' ------------------ ' this is called when we need to draw the windows contents, ' also called when the slider is moved LOCAL width, height, supports_alpha TYPE int LOCAL cr TYPE cairo_t* cr = gdk_cairo_create(widget->window) IF (supports_alpha) THEN ' transparent cairo_set_source_rgba(cr, 1.0, 1.0, 1.0, 0.0) ELSE ' opaque white cairo_set_source_rgb(cr, 1.0, 1.0, 1.0) END IF ' draw the background cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE) cairo_paint(cr) ' draw a red rectangle gtk_window_get_size(GTK_WINDOW(widget), &width, &height) cairo_set_source_rgba(cr, 1, 0.2, 0.2, alpha_value) cairo_rectangle(cr, 5, 45, width - 10, height - 50) cairo_fill(cr) cairo_stroke(cr) cairo_destroy(cr) END SUB
' ------------------ SUB CLICKED(GtkWindow *win, GdkEventButton *event, gpointer user_data) ' ------------------ ' toggle window manager frames gtk_window_set_decorated(win, !gtk_window_get_decorated(win)) END SUB
' ------------------ SUB MK_GUI() ' ------------------ gtk_init(0, 0) ' our main window, have it public so we can call gtk_widget_queue_draw(), ' initial alpha value of rectangle alpha_value = 0.8 ' the slider that will set alpha_value ' emit "change-value" to repaint the new rectangle slider = gtk_hscale_new_with_range(0.0, 100.0, 5.0) gtk_range_set_update_policy(GTK_RANGE(slider), GTK_UPDATE_DELAYED) gtk_range_set_value(GTK_RANGE(slider), alpha_value * 100.0) g_signal_connect(G_OBJECT(slider), "change-value", G_CALLBACK(SLIDER_VALUE_CHANGED), NULL) ' create a table to which we will add the add a slider table = gtk_table_new(2, 1, FALSE) gtk_table_attach(GTK_TABLE(table), GTK_WIDGET(slider), 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0) ' some settings for our main window window = gtk_window_new(GTK_WINDOW_TOPLEVEL) gtk_window_set_decorated(GTK_WINDOW(window), 0) gtk_window_set_title(GTK_WINDOW(window), "Alpha Demo") gtk_window_resize(GTK_WINDOW(window), 200, 200) gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER) gtk_container_add(GTK_CONTAINER(window), table) g_signal_connect(G_OBJECT(window), "delete-event", EXIT_PROG, NULL) ' tell GTK that we want to draw the windows background ourselves. ' if we don't do this then GTK will clear the window to the ' opaque theme default color, which isn't what we want. gtk_widget_set_app_paintable(window, TRUE) ' we need to handle two events ourselves: "expose-event" and "screen-changed". ' the X server sends us an expose event when the window becomes ' visible on screen. It means we need to draw the contents. On a ' composited desktop expose is normally only sent when the window ' is put on the screen. On a non-composited desktop it can be ' sent whenever the window is uncovered by another. ' the screen-changed event means the display to which we are ' drawing changed. GTK supports migration of running ' applications between X servers, which might not support the ' same features, so we need to check each time. g_signal_connect(G_OBJECT(window), "expose-event", G_CALLBACK(EXPOSE), NULL) g_signal_connect(G_OBJECT(window), "screen-changed", G_CALLBACK(SCREEN_CHANGED), NULL) ' toggle title bar on click ' we add the mask to tell X we are interested in this event gtk_widget_add_events(window, GDK_BUTTON_PRESS_MASK) g_signal_connect(G_OBJECT(window), "button-press-event", G_CALLBACK(CLICKED), NULL) ' initialize for current display SCREEN_CHANGED(window, NULL, NULL) ' we are ready to run g_signal_connect_data(window, "delete-event", EXIT_PROG, 0, 0, 0) gtk_widget_show_all(window) END SUB
' *********************** ' END SUBS & FUNCTIONS ' ***********************
' *********************** ' MAIN ' ***********************
MK_GUI() DISPLAY()
' *********************** ' END MAIN ' ***********************
Attachments:
|
|
|
Post by konaexpress on Mar 16, 2014 15:47:58 GMT 1
Wow Vovchick, don't stop there. You could be on your way to making the first BaCon terminal.
John
|
|
|
Post by vovchik on Mar 16, 2014 17:33:50 GMT 1
Dear guys, Here, at last, is a fully functional BaCon alpha windowless popup for inline svgs. Still needs a tiny bit of cleaning, perhaps, but it works just fine. Now I have to parametrize this thing so that one can specify geometry, colour, opacity, font attributes, position, timing and actual text from the command line - using Barry's code popup/daemon. Have fun incorporating this thing into your own progs.... With kind regards, vovchik PS. Works with beta 2.5 but doesn't like returning a pixbuf TYPE in 2.4, so please use the latest 2.5 beta to compile. PPS. No external dependencies, apart from the gtk/gdk/cairo bits that are standard. Alpha compositing for the display is needed, however, for real transparency effects. PPPS. I have just added an archive with the source and a 32-bit binary compiled in Mint-16. UPDATED: 17 Mar: Just a clean-up plus antialiasing; and I have also done a version with a tooltip message, which might be useful. I will post that below before long. ' ***************************************************** ' PROGRAM: proto_alphademo2.bac ' PURPOSE: demo a transparent gtk window with svg ' AUTHOR: vovchik ' MODDED: ' DEPENDS: gcc, bacon, gtk ' PLATFORM: Puppy Linux(actually, any *nix) ' DATE: 15-03-2014 ' NOTES: Use BaCon 2.5b (tested with v. 13-03-14) ' LICENSE: GPL3 ' *****************************************************
' *********************** ' COMPILER DIRECTIVES ' ***********************
' for BaCon => 2.5 only PRAGMA LDFLAGS `pkg-config --libs gtk+-2.0` PRAGMA OPTIONS `pkg-config --cflags gtk+-2.0` PRAGMA INCLUDE cairo.h gtk/gtk.h gdk/gdk.h
' *********************** ' END COMPILER DIRECTIVES ' ***********************
' *********************** ' EXTERNAL FUNCTIONS ' ***********************
' gtk PROTO gtk_init PROTO gtk_main ALIAS DISPLAY PROTO gtk_main_quit PROTO gtk_widget_add_events PROTO gtk_widget_get_screen PROTO gtk_window_new PROTO gtk_widget_queue_draw PROTO gtk_window_resize PROTO gtk_widget_set_app_paintable PROTO gtk_widget_set_colormap PROTO gtk_widget_set_size_request PROTO gtk_widget_show_all PROTO gtk_window_get_size PROTO gtk_window_move PROTO gtk_window_set_decorated PROTO gtk_window_set_position PROTO gtk_window_set_skip_pager_hint PROTO gtk_window_set_skip_taskbar_hint PROTO gtk_window_set_title ' gdk PROTO gdk_cairo_create PROTO gdk_cairo_set_source_pixbuf PROTO gdk_pixbuf_loader_close PROTO gdk_pixbuf_loader_get_pixbuf PROTO gdk_pixbuf_loader_new PROTO gdk_pixbuf_loader_write PROTO gdk_screen_get_rgb_colormap PROTO gdk_screen_get_rgba_colormap ' cairo PROTO cairo_destroy PROTO cairo_fill PROTO cairo_paint PROTO cairo_set_antialias PROTO cairo_set_operator PROTO cairo_set_source_rgb PROTO cairo_set_source_rgba PROTO cairo_stroke ' gobject PROTO g_signal_connect
' *********************** ' END EXTERNAL FUNCTIONS ' ***********************
' *********************** ' INITIALIZATION ' ***********************
DECLARE alpha_value TYPE double DECLARE supports_alpha TYPE int DECLARE window TYPE GtkWidget* DECLARE svg_string$ TYPE STRING svg_string$ = CONCAT$("<svg width='660' height='100'>" \ " <defs>" \ " <linearGradient id='l1' gradientUnits='objectBoundingBox'" \ " x1='1' x2='1' y1='0' y2='1'>" \ " <stop stop-color='ghostwhite' offset='0'/>" \ " <stop stop-color='dimgray' offset='0.34'/>" \ " </linearGradient>" \ " </defs>" \ " <rect x='5' y='5' rx='15' ry='15' width='650' height='90'" \ " fill='url(#l1)' stroke='dimgray' fill-opacity='0.4' stroke-opacity='0.6'/>" \ " <text x='50%' y='68%' text-anchor='middle' fill='white' fill-opacity='0.8'" \ " font-family='Sans' font-size='50' font-weight='600'>Sample SVG Message</text>" \ " <text x='50%' y='89%' text-anchor='middle' fill='pink' fill-opacity='0.8'" \ " stroke-opacity='0.8' font-family='Sans' font-style='italic'" \ " font-size='18' font-weight='600'>(click mouse to dismiss)</text>" \ "</svg>")
' *********************** ' END INITIALIZATION ' ***********************
' *********************** ' SUBS & FUNCTIONS ' ***********************
' ------------------ FUNCTION SVG_BUFF(STRING svg$) ' ------------------ ' return a gdk pixbuf from inline svg data LOCAL pixloader TYPE GdkPixbufLoader* LOCAL pixbuf TYPE GdkPixbuf* LOCAL size TYPE NUMBER LOCAL i, res TYPE int size = LEN(svg$) LOCAL raw_array TYPE unsigned char ARRAY size FOR i = 0 TO size - 1 raw_array[i] = ASC(MID$(svg$, i + 1, 1)) NEXT i pixloader = gdk_pixbuf_loader_new() res = gdk_pixbuf_loader_write(pixloader, raw_array, size, 0) res = gdk_pixbuf_loader_close(pixloader, 0) pixbuf = gdk_pixbuf_loader_get_pixbuf(pixloader) RETURN pixbuf END FUNCTION
' ------------------ SUB EXIT_PROG() ' ------------------ PRINT "Bye-bye..." gtk_main_quit() END SUB
' ------------------ SUB SCREEN_CHANGED(GtkWidget *widget, GdkScreen *old_screen, gpointer userdata) ' ------------------ ' check screen alpha capability LOCAL screen TYPE GdkScreen* LOCAL colormap TYPE GdkColormap* supports_alpha = FALSE screen = gtk_widget_get_screen(widget) colormap = gdk_screen_get_rgba_colormap(screen) IF ISFALSE(colormap) THEN PRINT "Oops. Your screen does not support alpha channels!" colormap = gdk_screen_get_rgb_colormap(screen) supports_alpha = FALSE ELSE PRINT "Great. Your screen supports alpha channels!" supports_alpha = TRUE END IF gtk_widget_set_colormap(widget, colormap) END SUB
' ------------------ SUB EXPOSE(GtkWidget *widget, GdkEventExpose *event, gpointer userdata) ' ------------------ ' render svg via cairo LOCAL width, height TYPE int LOCAL cr TYPE cairo_t* cr = gdk_cairo_create(widget->window) IF ISTRUE(supports_alpha) THEN cairo_set_source_rgba(cr, 1.0, 1.0, 1.0, 0.0) ELSE cairo_set_source_rgb(cr, 1.0, 1.0, 1.0) END IF cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE) cairo_set_antialias(cr, CAIRO_ANTIALIAS_BEST) gtk_window_get_size(GTK_WINDOW(widget), &width, &height) ' stuff the gdk pixbuf into cairo gdk_cairo_set_source_pixbuf(cr, SVG_BUFF(svg_string$), 0, 0) cairo_paint(cr) cairo_fill(cr) cairo_stroke(cr) cairo_destroy(cr) END SUB
' ------------------ SUB MK_GUI() ' ------------------ ' set up main window gtk_init(0, 0) alpha_value = 1.0 window = gtk_window_new(GTK_WINDOW_TOPLEVEL) gtk_window_set_decorated(GTK_WINDOW(window), 0) gtk_window_set_title(GTK_WINDOW(window), "") gtk_window_resize(GTK_WINDOW(window), 660, 100) gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER) gtk_widget_set_app_paintable(window, TRUE) gtk_widget_add_events(window, GDK_BUTTON_PRESS_MASK) gtk_window_set_skip_pager_hint(GTK_WINDOW(window), TRUE) gtk_window_set_skip_taskbar_hint(GTK_WINDOW(window), TRUE) gtk_window_move(GTK_WINDOW(window), 200, 200) ' check screen for alpha SCREEN_CHANGED(window, NULL, NULL) ' callbacks for events g_signal_connect(G_OBJECT(window), "expose-event", G_CALLBACK(EXPOSE), NULL) g_signal_connect(G_OBJECT(window), "button-press-event", G_CALLBACK(EXIT_PROG), NULL) g_signal_connect(G_OBJECT(window), "delete-event", EXIT_PROG, NULL) ' render window visible gtk_widget_show_all(window) END SUB
' *********************** ' END SUBS & FUNCTIONS ' ***********************
' *********************** ' MAIN ' ***********************
MK_GUI() DISPLAY()
' *********************** ' END MAIN ' ***********************
Attachments:proto-svg.tar.gz (9.75 KB)
|
|
|
Post by bigbass on Mar 16, 2014 19:26:39 GMT 1
Hey vovchik
compiled and ran perfectly Looking really good!
on LMDE 32bit with the latest beta 2,5,5 Joe
|
|
|
Post by barryk on Mar 17, 2014 4:41:28 GMT 1
Hello barryk This is a progress report for your popup app I forgot to mention this is using your latest as of the post date First off, everything is looking really good! Now using BaCon version 2.5.5 beta - (c) Peter van Eerten - GPL v3. and it looks like Peter fixed it so it will compile correctly without moving the include for hug to the top These are minor tweaks which will be based on the distro/window manager but anyway they maybe useful to get the settings fine tuned for the window manager in use This is what I get before on mint 16 and xfce as the window manager View AttachmentThis is after the small adjustments below View Attachment HUGOPTIONS("FONT DejaVu Sans 10")
button_x=BUTTON("x",-1,-1)
ATTACH(mainwin,button_x,sizereq.req_width+20,20) Getting everything fined tuned for every distro and every window manger can only be done by user feedback so here is a progress report Joe Joe, Did you use the latest code that I uploaded on 10th March? I think from your above post, you have it -- I fixed a couple of things, comment from my blog posted 10th March: The code now tests if the image exists, if not, uses an "X". Also, there was a bug parsing the fontname. Have re-uploaded code and binary. I am away from home right, but I see you guys have some very interesting input on improving it, so will read this thread again when I am at home. Note, I fixed that problem with compiling, with hug.bac not at beginning of file. My code had a variable "i" before including hug.bac, which conflicted. I changed it's name to "ii" and that fixed it. Regards, Barry Kauler
|
|
|
Post by vovchik on Mar 17, 2014 15:30:01 GMT 1
Dear guys, Here is the same thing, but without the svg line about clicking to dismiss. That shows up in a tooltip when you hover over the message. With kind regards, vovchik Attachments:proto-tooltip.tar.gz (9.89 KB)
|
|
|
Post by vovchik on Apr 2, 2014 9:42:53 GMT 1
Dear all, I have come up with a notify popup that has lots of parameters (thanks a million, Peter, for CMDLINE) and uses compositing in order to show a transparent window. Nice svg bounding boxes can be used and the colours set via command line parameters. Running the program without any parameters will show you the help. I am still working out kinks relating to the scaling of bounding boxes when text is at an angle. The archive contains the source, a 32-but binary compiled on Mint 16 using Bacon beta 2.55 (1 April). Only standard GTK libs are used. Run the demo script to see what it can do. Everything should work fine if you have compositing on your display. Please see the readme in the archive for installation instructions. With kind regards, vovchik Attachments:notifysvg.tar.gz (41.41 KB)
|
|
|
Post by 01micko on Jul 20, 2014 9:49:06 GMT 1
Dear vovchik! I have been thinking about writing a splash type message program both light and pretty for a long time. I had ventured into gtk/svg solutions but they were too complicated and didn't do what I wanted. Well I finally did it and the result is cairo-msg. It is written in C and depends on Xlib and Cairo. I wonder if you (or Joe or anyone) is interested in BaConizing it? Cheers! Mick PS: with Cairo, no compositor is necessary for transparency, reducing overhead.
|
|