minimize on mac Topic is solved

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
aquawicket
Earned some good credits
Earned some good credits
Posts: 103
Joined: Sun Aug 05, 2007 5:49 am

minimize on mac

Post by aquawicket »

I am trying to minimize or "iconize" on mac. I don't want to use the caption bar since my app supplies it own graphic style. I am working correctly from TopLevelWindow:: but my call to TopLevelWindow::Iconize, within IsWindowCollapsable
returns false. Any Ideas?

OS X 10.4.10, XCode 2.4.1, wx 2.8.5
aquawicket
Earned some good credits
Earned some good credits
Posts: 103
Joined: Sun Aug 05, 2007 5:49 am

Post by aquawicket »

Here is what I found in the docs about the MAC api
mabey their is a way to fake the kWindowCollapseBoxAttribute.

Code: Select all

IsWindowCollapsable
Determines whether a window can be collapsed.

Boolean IsWindowCollapsable (
   WindowRef window
);
Parameters
window
The window to be examined.

Return Value
If true, the window can be collapsed; otherwise, false.

Discussion
You can call the IsWindowCollapsable function to determine if a given window can be collapsed by the CollapseWindow function. On Mac OS X, the presence or absence of the kWindowCollapseBoxAttribute is the primary way of determining whether a window can be collapsed. If that attribute is not present, the Window Manager checks for the kWindowCanCollapse feature bit.

Availability
Available in CarbonLib 1.0 and later when Appearance 1.0 or later is present.
Available in Mac OS X v10.0 and later.
Declared In
MacWindows.h

I have tried wxDEFAULT_FRAME_STYLE | wxFRAME_SHAPED and have been able to get the ICONIZE back that way, but then it kills my maximize and I get mouse flicker while dragging. It would be great if their was a "hide caption" function so everything worked and the resize corner was still available.
aquawicket
Earned some good credits
Earned some good credits
Posts: 103
Joined: Sun Aug 05, 2007 5:49 am

Post by aquawicket »

This is still driving me insane. Their must be a way to have a window on OSX that does not have a caption bar but is still minimizable, maximizeable, and resizeable.
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

Hi,

supplying your own graphica style for everything might be possible using lower-level functions from Carbon or Cocoa.
wxWidgets, as a cross-platform toolkit, cannot go deeply in platform-specific code. Shaped windows offer possibilities to customise shape and everything but i've rarely seen applications with custom shapes/style be resizable (except Quicktime perhaps)

My suggestions for what they're worth:
1) Just use a normal caption bar, nearly all OS X apps do, you can provide your graphical style for everything else
2) Use a shaped frames and catch mouse events and do the frame resize yourself (i have not tried, i am not sure it is possible)
3) dig in Carbon and in the implementation of wxWidgets. There must be a way to do this in OS X, but keep in mind this is very specific needs, so they may not be covered by wxWidgets
4) cheap cheat : when the user clicks 'collapse', turn the window into one with a normal caption bar and collapse it
5) join the mailing list where it is easier to contact the actual wx devs

good luck
pdabhi
In need of some credit
In need of some credit
Posts: 7
Joined: Tue Jul 30, 2013 11:55 am

Re: minimize on mac

Post by pdabhi »

Sorry for replying to an already closed topic.
But I am really stuck at this point. I have the came custom window style iconize problem under MAC. I am using widgets version 2.8.12 on Snow Leopard.
All functionality are perfectly working for Maximize and Resize ( I have handled mouse events for resizing).
But now stuck on Iconize, as it does nothing.

Can someone please guide me if someone somehow managed to solve this. I don't mind placing platform specific MAC API code.
@aquawicket how did you managed to get around this problem ? Could you please guide me out of this ?

Thanks & Regard,
Pratik.
User avatar
doublemax
Moderator
Moderator
Posts: 19159
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: minimize on mac

Post by doublemax »

I can't help with this and unfortunately there are hardly any OSX user in this forum.

But you should try again with wxWidgets 3.0.0. Version 2.8.12 is pretty old already, especially its OSX part.
Use the source, Luke!
pdabhi
In need of some credit
In need of some credit
Posts: 7
Joined: Tue Jul 30, 2013 11:55 am

Re: minimize on mac

Post by pdabhi »

Thanks for the reply.
Ya, I guess I need to update to the latest stable version first, then proceed on coz as of now I could not be able to achieve what i desired. Used Carbon API's but that also did not allow me to switch between window classes.

Regards,
Pratik.
moki
Earned a small fee
Earned a small fee
Posts: 14
Joined: Mon Dec 08, 2014 1:08 pm
Location: Brive la gaillarde

Re: minimize on mac

Post by moki »

I'm not sure I encounter the same problem, but maybe my solution can help someone...

Our application is in fullscreen mode and calling Iconize() alone has not effect. But if going out of fullscreen first, it works as expected :

Code: Select all

my_frame->ShowFullScreen(false);
my_frame->Iconize();
And of course we have to return to fullscreen mode when restoring the application :

Code: Select all

void MyFrame::OnIconize(wxIconizeEvent& /*event*/)
{
    if (!IsIconized())
        ShowFullScreen(true);
}
Our application uses the wxWidgets 3.1 with Cocoa API.
Post Reply