[Mac] Window live resize

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

[Mac] Window live resize

Post 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
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: [Mac] Window live resize

Post 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
User avatar
Shardik
Addict
Addict
Posts: 2058
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

Re: [Mac] Window live resize

Post 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
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: [Mac] Window live resize

Post by Polo »

Nice trick! :)
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: [Mac] Window live resize

Post 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).
Post Reply