Page 1 of 1

[Mac] Window live resize

Posted: Wed Aug 31, 2011 6:43 am
by Polo
Hi,

In reference to this:
http://www.purebasic.fr/english/viewtop ... 19&t=36651

Could we have by default a live resize Window, which looks more standard on MacOSX?

Many thanks,
Gaetan

Re: [Mac] Window live resize

Posted: Wed Sep 07, 2011 8:32 pm
by Polo
Still on windows, it'd be nice if the grow box (bottom right part when the window can be resized) had a standard look, on most Lion apps it is not even show, or is transparent. Only on PB apps the grow box background color is white, and it doesn't look really good.
Plus, the bottom corners of standard Mac windows are quite often rounded. It'd be nice as well if we could have that in our PB apps.

About status bar, i'd love to have a standard status bar as well, ie same look as the toolbar (see Itunes or Finder for example).

Thanks,
Gaetan

Re: [Mac] Window live resize

Posted: Wed Sep 07, 2011 9:55 pm
by Shardik
Polo wrote:Only on PB apps the grow box background color is white, and it doesn't look really good.
You may use this workaround to obtain a transparent grow box:

Code: Select all

EnableExplicit

ImportC ""
  HIViewGetFirstSubview(ViewRef.L)
  HIViewGetKind(ViewRef.L, *HIViewKind)
  HIViewGetNextView(ViewRef.L)
  HIViewGetRoot(WindowRef.L)
  HIGrowBoxViewSetTransparent(GrowBoxRef.L, Transparent.L)
EndImport

Structure HIViewKind
  Signature.L
  Kind.L
EndStructure

Procedure SetGrowBoxTransparent(WindowID.L)
  Protected RootView.L
  Protected SubView.L
  Protected ViewKind.HIViewKind

  RootView = HIViewGetRoot(WindowID(WindowID))
  
  If RootView
    SubView = HIViewGetFirstSubview(RootView)
    
    While SubView <> 0
      If HIViewGetKind(SubView, @ViewKind) = 0
        If ViewKind\Kind = 'grow'
          HIGrowBoxViewSetTransparent(SubView, #True)
          Break
        EndIf
      EndIf

      SubView = HIViewGetNextView(SubView)
    Wend
  EndIf
EndProcedure

OpenWindow(0, 270, 100, 250, 120, "Transparent grow box", #PB_Window_SystemMenu | #PB_Window_SizeGadget)
SetGrowBoxTransparent(0)

Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow

Re: [Mac] Window live resize

Posted: Thu Sep 08, 2011 8:32 pm
by Polo
Nice trick! :)

Re: [Mac] Window live resize

Posted: Fri Sep 09, 2011 11:53 pm
by Polo
Still about resizing, the resize arrows doesn't show up when trying to resize the window, unlike any other Mac program (OSX Lion).