gdk_window_set_keep_above ()
Posted: Sun Jan 11, 2015 9:47 pm
how to use, whether it is possible to raise them to the forefront of the gadget that is, (above)
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
ImportC ""
gtk_main_quit()
gtk_window_set_title(*win.GtkWidget, text.p-Utf8)
g_signal_connect(instance.i, detailed_signal.p-Utf8, c_handler.i, pdata.i) As "g_signal_connect_data"
g_object_set_data(object.i, key.p-Utf8, pdata.i)
EndImport
Define.GtkWidget *win
gtk_init_(#Null, #Null)
*win = gtk_window_new_(#GTK_WINDOW_TOPLEVEL)
gtk_window_set_title(*win, "foo")
gtk_widget_set_size_request_(*win, 250, 150)
gtk_window_set_position_(*win, #GTK_WIN_POS_CENTER)
g_signal_connect(*win, "destroy", @gtk_main_quit(), #Null)
gtk_widget_show_(*win)
gdk_window_set_keep_above_(*win, #True)
gtk_main_()
The following code was successfully tested with PB 5.31 on these distributions:[color=#0040FF]GDK 2 Reference Manual[/color] wrote:On X11, asks the window manager to keep window below, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don't have a concept of "keep below"; so you can't rely on the window being kept below. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen.
Code: Select all
*Window1.GtkWidget = OpenWindow(1, 100, 100, 200, 100, "Window 1")
OpenWindow(2, 200, 150, 200, 100, "Window 2")
gdk_window_set_keep_above_(*Window1\window, #True)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindowI needed it for gadget,Why don't you use PB's StickyWindow() command which I assume to simply wrap gdk_window_set_keep_above()?
i use this:ambrose wrote:is there a way to tell if the user running my program is an administrator or not?
Code: Select all
Procedure isRoot()
If getuid_() = 0
ProcedureReturn 1 ; true - is root
Else
ProcedureReturn 0 ; false - some other user
EndIf
EndProcedureNo one is that it does not know how to do it?I needed it for gadget,can not find how raised gadget.
this is it possible to change the z-order?gtk_overlay_reorder_overlay ()
void
gtk_overlay_reorder_overlay (GtkOverlay *overlay,
GtkWidget *child,
gint position);
Moves child to a new index in the list of overlay children. The list contains overlays in the order that these were added to overlay .
A widget’s index in the overlay children list determines which order the children are drawn if they overlap. The first child is drawn at the bottom. It also affects the default focus chain order.
Code: Select all
gdk_window_lower_
gdk_window_set_keep_below_
gtk_window_set_keep_below_