I have tested your modified 1st example below successfully with these Linux distributions (no close button in Window 2):GTK+ 2 Reference Manual wrote:By default, windows have a close button in the window frame. Some window managers allow GTK+ to disable this button. If you set the deletable property to FALSE using this function, GTK+ will do its best to convince the window manager not to show a close button. Depending on the system, this function may not have any effect when called on a window that is already visible, so you should call it before calling gtk_window_show().
- ElementaryOS 0.2 x86 with Pantheon
- Fedora 20 x86 with Gnome 3
- Kubuntu 10.04 x86 with KDE
- Kubuntu 14.04 x86 with KDE
- Linux Mint 17 x86 with Cinnamon
- OpenSuse 11.1 x86 with KDE (reported by Vera)
- PearOS 8 x86 with heavily modified Gnome 3
- Xubuntu 14.04 x86 with Xfce (a "+" button is displayed instead of an "x" button in Window 2 but it doesn't close Window 2!)
It doesn't work on these distributions (Close button is still displayed and operational):
- andLinux/Kubuntu 9.04 x86 with KDE (running with a modified CoLinux kernel as task in Windows XP SP3)
- Bodhi Linux 2.4.0 with Enlightenment 17
- Lubuntu 14.04 x86 with LXDE
- Ubuntu 10.04 x86 with Gnome 2
- Ubuntu 14.04 x86 with Unity
Code: Select all
CompilerIf #PB_Compiler_OS = #PB_OS_Linux
Import ""
gtk_window_set_deletable(*Window.GtkWindow, Setting.I)
EndImport
CompilerEndIf
If OpenWindow(0, 0, 0, 320, 240, "Window 1", #PB_Window_ScreenCentered|#PB_Window_SystemMenu)
If OpenWindow(1, 0, 0, 240, 120, "Window 2", #PB_Window_Tool|#PB_Window_WindowCentered,WindowID(0))
DisableWindow(0,1)
CompilerIf #PB_Compiler_OS = #PB_OS_Linux
gtk_window_set_deletable(WindowID(1), #False)
gtk_widget_show_(WindowID(1))
CompilerEndIf
SetActiveWindow(1)
ButtonGadget(0, 60, 40, 120, 25, "Close Window 2")
EndIf
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
Select EventGadget()
Case 0 : CloseWindow(1) : DisableWindow(0,0) : SetActiveWindow(0)
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow
EndIf
End

