tags:

views:

346

answers:

2

I've run into an issue using a wxDialog object on Linux In the construtor for the object I pass the relevant style flags (wxCAPTION|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxCLOSE_BOX|wx_RESIZE_BORDER) but the buttons don't show up. When I was designing the class in wxformbuilder they would appear on the displayed design but don't show up in my running application.

I'm using wxWidgets 2.8.7 at the moment and running on Scientific Linux 5 (RHEL 5). Any suggestions or ideas on how to work around this?

EDIT: BTW, This is related to this question

+1  A: 

Can you use a wxWindow instead of a wxDialog? Maybe it doesn't make sense to minimize a dialog but those are usual operations for application windows.

zooropa
THat's actually how the code is written but I can't seem to get the modal behavior I want (see link in my edit).
dagorym
A: 

If you create a dialog on wxGTK then during construction

gtk_window_set_type_hint(GTK_WINDOW(m_widget), GDK_WINDOW_TYPE_HINT_DIALOG);

is called, which leaves it up to the window manager what decoration is shown for this window. So if you give it the style but no buttons are shown, then there's nothing you can do. In any case, I think showing a wxFrame while the parent frame is disabled should work just as well.

mghie
I couldn't even get this to compile. Do you have a link that references how to use this function? Is it part of wxWidgets?
dagorym
As I wrote: This is part of the wxWidgets sources and is called during dialog construction. What this shows is that not wxWidgets is responsible, but that the window manager decides how the dialog is decorated, so there's nothing you can do. wxMINIMIZE_BOX and wxMAXIMIZE_BOX are simply ignored. You can't have a dialog with those buttons on your current Linux desktop.
mghie
Got it, I misread your comment. Thanks.
dagorym