gdk_window_set_keep_above ()

Linux specific forum
mestnyi
Addict
Addict
Posts: 1102
Joined: Mon Nov 25, 2013 6:41 am

gdk_window_set_keep_above ()

Post by mestnyi »

how to use, whether it is possible to raise them to the forefront of the gadget that is, (above)
Justin
Addict
Addict
Posts: 956
Joined: Sat Apr 26, 2003 2:49 pm

Re: gdk_window_set_keep_above ()

Post by Justin »

Does this work? i have not tried it.

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_()

User avatar
Shardik
Addict
Addict
Posts: 2067
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: gdk_window_set_keep_above ()

Post by Shardik »

The successful working of gdk_window_set_keep_above( ) can't be guaranteed because the window manager of your distribution has to support the operation:
[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.
The following code was successfully tested with PB 5.31 on these distributions:
- Bodhi Linux 2.4.0 x86 with Enlightenment E17
- Elementary OS 0.2 x86 with Pantheon
- Fedora 20 x86 with Gnome 3
- Linux Mint 17 x86 with Cinnamon
- Kubuntu 14.04 x86 with KDE
- Lubuntu 14.04 x86 with LXDE
- Ubuntu 14.04 x86 with Unity
- Xubuntu 14.04 x86 with Xfce

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_CloseWindow
Why don't you use PB's StickyWindow() command which I assume to simply wrap gdk_window_set_keep_above()?
mestnyi
Addict
Addict
Posts: 1102
Joined: Mon Nov 25, 2013 6:41 am

Re: gdk_window_set_keep_above ()

Post by mestnyi »

Why don't you use PB's StickyWindow() command which I assume to simply wrap gdk_window_set_keep_above()?
I needed it for gadget, :) can not find how raised gadget. :cry:
broozar
User
User
Posts: 61
Joined: Sat May 08, 2010 11:21 pm
Location: Berlin, Germany

Re: gdk_window_set_keep_above ()

Post by broozar »

ambrose wrote:is there a way to tell if the user running my program is an administrator or not?
i use this:

Code: Select all

Procedure isRoot()
  If getuid_() = 0
    ProcedureReturn 1 ; true - is root
  Else
    ProcedureReturn 0 ; false - some other user
  EndIf
EndProcedure
mestnyi
Addict
Addict
Posts: 1102
Joined: Mon Nov 25, 2013 6:41 am

Re: gdk_window_set_keep_above ()

Post by mestnyi »

I needed it for gadget, :) can not find how raised gadget. :cry:
No one is that it does not know how to do it?
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.
this is it possible to change the z-order?
mestnyi
Addict
Addict
Posts: 1102
Joined: Mon Nov 25, 2013 6:41 am

Re: gdk_window_set_keep_above ()

Post by mestnyi »

why not struct GtkOverlay?

Code: Select all

gdk_window_lower_
            gdk_window_set_keep_below_
              gtk_window_set_keep_below_
Post Reply