|
Post by SunBurnt on Mar 5, 2014 4:10:55 GMT 1
I could swear I did this a while back, but apparently I didn`t write it down in my notes.
Want a no-border window for a notify popup like the one Barry`s working on. For a different distro.
|
|
|
Post by bigbass on Mar 5, 2014 6:25:34 GMT 1
Hey Terry How's it going?
you are in luck this is done with one line of code place it toward the bottom
SETPROPERTY(window, "decorated", FALSE) if you decide to add back the decoration just change to TRUE
Joe
' BaCon / HUG Hello World no decoration on window ' hello3.bac ' Include the files for making a GUI. INCLUDE "hug.bac" INIT ' 1.) Create your main working window, 250 pixels wide x 100 pixels high window = WINDOW( "Hello Title Bar", 250, 100 ) ' 2. ) Create a label Hello BaCon! with text, 150 x 30 My_label = MARK( "Hello BaCon!", 150, 30 ) ' 3.) Attach the label to the main window ATTACH( window, My_label, 50, 20 ) ' 4.) Create a button My_btn = BUTTON( "I'm done", 80, 25) ' 5.) Attach button to the main window ATTACH( window, My_btn, 10, 60 ) ' 6.) Make button do something CALLBACK( My_btn, QUIT) '7.) Create a button. My_chk = STOCK("gtk-quit", 80, 25) ATTACH( window, My_chk, 155, 60 ) SETPROPERTY(window, "decorated", FALSE)
'8.)Make button do something CALLBACK( My_chk, QUIT)
DISPLAY
|
|
|
Post by SunBurnt on Mar 5, 2014 7:51:52 GMT 1
Hi Joe, a little while no talk to... You should stop by the Puppy forum and check in on DebianDog.
I thought that would be the answer, but that only removes the window`s decorations, not the borders.
I want a plain white square to put a canvas on. I`ve done this before, just can`t remember how...
I`ve tried using SETPROPERTY, PROPERTY, and these imports:
IMPORT "gtk_container_set_border_width(long,int)" FROM "libgtk-x11-2.0.so" TYPE void
gtk_container_set_border_width(win_, 0)
'IMPORT "gtk_window_set_decorated(long,int)" FROM "libgtk-x11-2.0.so" TYPE void
gtk_window_set_decorated(win_, 0)
|
|
|
Post by barryk on Mar 5, 2014 13:43:05 GMT 1
I'm not using a canvas, but the same principle applies. In my case I am using a text widget. Here is the guts of my code:
HUGOPTIONS("WIDGET_SHOW 0") 'set xsize,ysize to -1,-1, then window will fit the widget... mainwin = WINDOW("",-1,-1)
PROPERTY(mainwin,"decorated",FALSE) PROPERTY(mainwin,"skip-taskbar-hint",TRUE) PROPERTY(mainwin,"skip-pager-hint",TRUE) PROPERTY(mainwin,"accept-focus",FALSE)
'ref: https://developer.gnome.org/gtk2/2.24/GtkWindow.html IF level$=="top" THEN gtk_window_set_keep_above(mainwin,TRUE) IF level$=="bottom" THEN gtk_window_set_keep_below(mainwin,TRUE)
background_func() placement_func() 'oldwidth used in width_func()... oldwidth=width
HUGOPTIONS("WIDGET_SHOW 1")
msg_id=MARK(msg_ptr+off1,width,-1) FONT(msg_id,fontname$) oldfontname$=fontname$ PROPERTY(msg_id,"xalign",0.0) PROPERTY(msg_id,"yalign",0.0) PROPERTY(msg_id,"wrap",TRUE) ATTACH(mainwin,msg_id,5,0)
I don't know the difference between PROPERTY and SETPROPERTY. I had to do the SHOW_WIDGET=0 then turn it on again. The only thing that appears on the screen is the text widget (with nice rounded corners, as I am using JWM window manager).
Note the "-1" for height, so it will automatically fit size of text. "width" is settable by end user.
Note, I gave up the inotify approach. Now writing a generic popup thingy that will work with any distro. I am writing it to all the things that I have ever wanted a popup msg box to do.
|
|
|
Post by vovchik on Mar 5, 2014 14:34:33 GMT 1
Dear guys, I also played around with notify at one point and posted this: notifyIt may be of some use....but I haven't looked at it for years. With kind regards, vovchik PS. Looking forward to Barry's source...and thanks in advance.
|
|
|
Post by bigbass on Mar 5, 2014 15:32:28 GMT 1
Hey vovchik I really like that effect you added thanks for posting the code it has the vovchik magical touch *barryK That sounds like an interesting project please attach the code when done or even in the testing phase we could test it out on our various boxes and give some feedback reports Joe
|
|
|
Post by SunBurnt on Mar 5, 2014 21:43:28 GMT 1
Hi guys... It`s good to here from all of you again.
Barry; Using this does not show anything for me. ( Maybe I missed something.) I don`t want a slide up notice like Puppy shows just above the tray icons at lower right. I want a popup message like Puppy has that has beveled edges. It might be GtkDialog.
HUGOPTIONS("WIDGET_SHOW 0")
win_ = WINDOW("", winW, winH)
PROPERTY(win_, "decorated", FALSE) PROPERTY(win_,"skip-taskbar-hint",TRUE) PROPERTY(win_,"skip-pager-hint",TRUE) PROPERTY(win_,"accept-focus",FALSE)
HUGOPTIONS("WIDGET_SHOW 1") DISPLAY
vovchik; I have your slide up notice, and Joe`s right, it`s very nice. # How did you get rid of the window`s title bar and it`s border frame.?
Obviously we could just use the GTK+ MessageBox, I made an exec. dialog from it. But a custom one`s nicer, if not a pain to make. It should be pretty simple.
Just getting the blank window is the problem, making it slide and hide should be easy. .
|
|
|
Post by barryk on Mar 7, 2014 3:37:33 GMT 1
|
|
|
Post by SunBurnt on Mar 7, 2014 8:35:17 GMT 1
Thanks Barry, I`ll be looking at it along with vovchik`s notify gui.
My needs are very simple compared to what you guys have made.
|
|
|
Post by SunBurnt on Mar 12, 2014 7:16:11 GMT 1
Thanks Barry, I just got it to work. Many thinks. The trick seems to be the HugOptions and extra properties.
INCLUDE "/usr/share/BaCon/BaCon/hug.bac",INIT,DISPLAY,HUGOPTIONS,WINDOW,PROPERTY,SHOW INIT HUGOPTIONS("WIDGET_SHOW 0")
mainwin = WINDOW("",100,100)
PROPERTY(mainwin,"decorated",FALSE) PROPERTY(mainwin,"skip-taskbar-hint",TRUE) PROPERTY(mainwin,"skip-pager-hint",TRUE) PROPERTY(mainwin,"accept-focus",FALSE)
HUGOPTIONS("WIDGET_SHOW 1") SHOW(mainwin)
DISPLAY
|
|
|
Post by basica on Jun 19, 2014 21:08:08 GMT 1
Thanks Barry, I just got it to work. Many thinks. The trick seems to be the HugOptions and extra properties. INCLUDE "/usr/share/BaCon/BaCon/hug.bac",INIT,DISPLAY,HUGOPTIONS,WINDOW,PROPERTY,SHOW INIT HUGOPTIONS("WIDGET_SHOW 0")
mainwin = WINDOW("",100,100)
PROPERTY(mainwin,"decorated",FALSE) PROPERTY(mainwin,"skip-taskbar-hint",TRUE) PROPERTY(mainwin,"skip-pager-hint",TRUE) PROPERTY(mainwin,"accept-focus",FALSE)
HUGOPTIONS("WIDGET_SHOW 1") SHOW(mainwin)
DISPLAY
|
|
|
Post by basica on Jun 19, 2014 21:17:22 GMT 1
You guys have done an amazing job of expanding and documenting Bacon. I first looked at Bacon a few years ago and tried it out a bit, then got sidetracked on other things. Wow, what a difference.
So my first attempt was to create a simple window here.
INCLUDE "/usr/share/BaCon/hug.bac" INIT Mainwin = WINDOW( "" , 300, 400 ) SETPROPERTY(Mainwin, "decorated", FALSE) SETPROPERTY(Mainwin, "tooltip-text", "Testing the properties") DISPLAY
It compiled and ran without complaint, but nevertheless showed the window as decorated. So I tried every variant I could think of to get it undecorated without success. As a general test, tooltip-text was added and worked. I've also tried the other alternatives shown in this thread and other examples without success for undecorating. All the other properties I tried seemed to work.
I'm using Bacon 3 and the latest hug-93.bac.
Is there something I've completely missed or could this be a control issue with the window manager (JWM).
Thanks again for all your fantastic work, basica
|
|
|
Post by alexfish on Jun 19, 2014 22:53:43 GMT 1
Hi basica
Looks like it may be the WM
have tested the code on Mint debian 16
and it shows as it should , not decorated
BR Alex
|
|
|
Post by basica on Jun 20, 2014 0:00:04 GMT 1
Hi basica Looks like it may be the WM have tested the code on Mint debian 16 and it shows as it should , not decorated BR Alex Thanks Alex, Looking at the recent tutorial "Porting gtk using PROTO explained by bigbass" , I tried this code below using PROTO and ALIAS and it worked- PRAGMA LDFLAGS `pkg-config --cflags --libs gtk+-2.0`
PROTO gtk_init ALIAS INIT PROTO gtk_window_new ALIAS WINDOW PROTO gtk_window_set_title ALIAS TITLE PROTO g_signal_connect_data ALIAS CALLBACK PROTO gtk_widget_show_all ALIAS SHOW_ALL PROTO gtk_main ALIAS DISPLAY PROTO gtk_main_quit ALIAS QUIT PROTO gtk_window_set_decorated ALIAS SET_DECORATED
GTK_WINDOW_TOPLEVEL = 0
SUB exit_prog QUIT END SUB
INIT(0, 0) window = WINDOW(GTK_WINDOW_TOPLEVEL) TITLE(window, "") SET_DECORATED(window,FALSE)
CALLBACK(window, "delete-event", exit_prog, 0, 0, 0) SHOW_ALL(window) DISPLAY
Interesting, I'll try out the original code on some other WM.
|
|
|
Post by alexfish on Jun 20, 2014 0:30:25 GMT 1
Hi basica
May be the version of gtk , have u checked in the terminal for any err message ,
did a little hack a day to use the DECORATED
INCLUDE "hug.bac"
Gtk$= HUGLIB$("gtk")
IMPORT gtk_window_set_decorated(long,int) FROM Gtk$ TYPE void ALIAS DECORATE
Mainwin = WINDOW( "" , 300, 400 ) DECORATE(Mainwin,FALSE)
SETPROPERTY(Mainwin, "tooltip-text", "Testing the properties")
DISPLAY
HTH Alex
|
|