hello guys,
i need a way to make a window fully transparent, while i can choose the operciy intensity of the window on windows, linux and mac. i know that this is only doable by os-api.
have someone any idea, how to realize that?
kind regards
kurt
transparent window
-
IdeasVacuum
- Always Here

- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: transparent window
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
delikanli_19_82
- User

- Posts: 38
- Joined: Tue Jun 21, 2011 6:11 pm
Re: transparent window
hello guys,
i asked the same question in the german forum. there is a well solution for windows:
original thread http://forums.purebasic.com/german/view ... 54711ba1e2
the mac-solution from shardik is the same on os x. thanks.
now i need a way to realize it also on linux.
kurt
i asked the same question in the german forum. there is a well solution for windows:
Code: Select all
Procedure.i SetWindowTransparency(Window.i, transparency.i) ; Fenster durchsichtig machen (transparency : 0-255)
If IsWindow(Window)
Protected WindowID = WindowID(Window)
SetWindowLongPtr_(WindowID,#GWL_EXSTYLE,#WS_EX_LAYERED)
SetLayeredWindowAttributes_(WindowID,0,transparency,#LWA_ALPHA)
EndIf
EndProcedure
OpenWindow( 100, 0, 0, 300, 300, "Test", #PB_Window_ScreenCentered )
SetWindowTransparency( 100, 220 )
Define e.l
Repeat
e = WaitWindowEvent()
Until e = #PB_Event_CloseWindow
the mac-solution from shardik is the same on os x. thanks.
now i need a way to realize it also on linux.
kurt
Re: transparent window
linux
Code: Select all
ImportC "-gtk"
gtk_window_set_opacity(*window.i,opacity.d);
gtk_widget_is_composited (*widget)
EndImport
win = OpenWindow(#PB_Any,0,0,200,200,"test")
If gtk_widget_is_composited (WindowID(win))
gtk_window_set_opacity(WindowID(win), 0.5);
EndIf
Repeat
ev=WaitWindowEvent()
Until ev = #PB_Event_CloseWindow
Windows 11, Manjaro, Raspberry Pi OS


