It is currently Sun Feb 16, 2020 9:31 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: MacOS "superview"
PostPosted: Sun Dec 02, 2018 5:31 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 2220
Location: Germany
The gadgets have no superview if they are in a second item of a PanelGadget.

Maybe you forgot to set this internally when creating the gadgets?

Code:
If OpenWindow(0, 0, 0, 322, 220, "PanelGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  PanelGadget     (0, 8, 8, 306, 203)
  AddGadgetItem (0, -1, "Panel 1")
  PanelGadget (1, 5, 5, 290, 166)
  AddGadgetItem(1, -1, "Sub-Panel 1")
  AddGadgetItem(1, -1, "Sub-Panel 2")
  AddGadgetItem(1, -1, "Sub-Panel 3")
  CloseGadgetList()
  AddGadgetItem (0, -1,"Panel 2")
  ButtonGadget(2, 10, 15, 80, 24,"Button 1")
  ButtonGadget(3, 95, 15, 80, 24,"Button 2")
  CloseGadgetList()
 
  Debug "Panel = " + GadgetID(0)
  Debug "Panel 1 = " + GadgetID(1)
  Debug "Button 2 = " + GadgetID(2)
 
  sv = CocoaMessage(0, GadgetID(1), "superview")
  sv = CocoaMessage(0, sv, "superview")
  Debug "Parent from Panel 1 = " + sv
 
  sv = CocoaMessage(0, GadgetID(2), "superview")
  sv = CocoaMessage(0, sv, "superview")
  Debug "Parent from Gadget 2 = " + sv
 
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf

_________________
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
 Post subject: Re: MacOS "superview"
PostPosted: Mon Dec 10, 2018 10:45 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 2220
Location: Germany
I think is not a Bug...

PB
PanelGadget -> AddItems -> Gadgets

OSX
TabView -> TabViewItems -> View -> (gadgets)
Problem is that the "View" have not a method to parent object.

Perhaps anyone habe a solution for me...

Please move to Code questions...

_________________
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
 Post subject: Re: MacOS "superview"
PostPosted: Tue Dec 11, 2018 8:08 am 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Aug 08, 2004 5:21 am
Posts: 3596
Location: Netherlands
I looked at it but unfortunately didn’t find an answer to the problem. :?

_________________
macOS 10.15 Catalina, PB 5.71 x64


Top
 Profile  
Reply with quote  
 Post subject: Re: MacOS "superview"
PostPosted: Tue Dec 11, 2018 4:24 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 2220
Location: Germany
wilbert wrote:
I looked at it but unfortunately didn’t find an answer to the problem. :?

I've searched several forums.
Here you can only use the forward approach to search all TabViewControllers until you have found the right one.

_________________
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
 Post subject: Re: MacOS "superview"
PostPosted: Mon Jan 07, 2019 3:54 pm 
Offline
Addict
Addict

Joined: Mon Nov 25, 2013 6:41 am
Posts: 805
Code:
If OpenWindow(0, 0, 0, 322, 220, "PanelGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  PanelGadget     (0, 8, 8, 306, 203)
  AddGadgetItem (0, -1, "Panel 1")
  PanelGadget (1, 5, 5, 290, 166)
  AddGadgetItem(1, -1, "Sub-Panel 1")
  AddGadgetItem(1, -1, "Sub-Panel 2")
  AddGadgetItem(1, -1, "Sub-Panel 3")
  CloseGadgetList()
  AddGadgetItem (0, -1,"Panel 2")
  ButtonGadget(2, 10, 15, 80, 24,"Button 1")
  ButtonGadget(3, 95, 15, 80, 24,"Button 2")
  CloseGadgetList()
 
  Debug "Panel = " + GadgetID(0)
  Debug "Panel 1 = " + GadgetID(1)
  Debug "Button 2 = " + GadgetID(2)
 
  sv = CocoaMessage(0, GadgetID(1), "superview")
  sv = CocoaMessage(0, sv, "superview")
  Debug "Parent from Panel 1 = " + sv
 
  SetGadgetState(0, 1)
  sv = CocoaMessage(0, GadgetID(2), "superview")
  sv = CocoaMessage(0, sv, "superview")
  Debug "Parent from Gadget 2 = " + sv
  SetGadgetState(0, 0)
 
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf

This is how it works. :)


Top
 Profile  
Reply with quote  
 Post subject: Re: MacOS "superview"
PostPosted: Mon Jan 07, 2019 8:58 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 2220
Location: Germany
However, this does not help if you are looking for the parent gadget for any gadget.
So we know that with the PanelGadget the active item only has a superview.

That's why in the forum for Objectiv-C you can only find the solution to find the right parent by searching all PanelGadgets forward.

_________________
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye