Check if Window is hidden
-
- Enthusiast
- Posts: 349
- Joined: Thu Jul 02, 2009 5:42 am
Check if Window is hidden
I know by using HideWIndow I can hide a window, but what call do I use to
find if the Window is hidden?
Thanks
find if the Window is hidden?
Thanks
Re: Check if Window is hidden
Does this help ?This should return if Window 0 is visible or not.
Code: Select all
IsVisible = CocoaMessage(0, WindowID(0), "isVisible")
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
-
- Enthusiast
- Posts: 349
- Joined: Thu Jul 02, 2009 5:42 am
Re: Check if Window is hidden
Works Perfect
Thanks
Thanks
Re: Check if Window is hidden
And for the gadget do not tell?
Re: Check if Window is hidden
Code: Select all
IsVisible = CocoaMessage(0, GadgetID(0), "isHidden")
Re: Check if Window is hidden
Code: Select all
IsVisible = Bool(CocoaMessage(0, GadgetID(0), "isHidden") = 0)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Check if Window is hidden
Sorry, should have been
A complete example:
Code: Select all
IsHidden = CocoaMessage(0, GadgetID(0), "isHidden")
Code: Select all
Define HiddenState.I
OpenWindow(0, 270, 100, 220, 95, "ButtonGadget demo")
ButtonGadget(0, 10, 20, 200, 25, "Hide button below")
ButtonGadget(1, 10, 55, 200, 25, "Visible button")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
If EventGadget() = 0 And EventType() = #PB_EventType_LeftClick
HiddenState ! 1
HideGadget(1, HiddenState)
If HiddenState
SetGadgetText(0, "Unhide button below")
Else
SetGadgetText(0, "Hide button below")
EndIf
Debug "Hidden state of 2nd button: " +
CocoaMessage(0, GadgetID(1), "isHidden")
EndIf
EndSelect
ForEver
Re: Check if Window is hidden
I didn't mean that bad. Thank you very much for the example.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Check if Window is hidden
I didn't assess your response as negative or bad. It was totally correct in modifing my incorrect example. Before posting I changed IsHidden to IsVisible and didn't take into account that true and false are switched. So I appreciated your correction...mk-soft wrote:I didn't mean that bad.