Avoid Segfauls in lots of methods when called with nil instead of FXApp, FXComposite or FXWindow objects
Lars Kanis
11 years ago
463 | 463 |
* Run popup menu while shown, until stop() or stopModal() is called.
|
464 | 464 |
* Also returns when entering previous cascading popup menu.
|
465 | 465 |
*/
|
466 | |
FXint runPopup(FXWindow* window);
|
|
466 |
FXint runPopup(FXWindow* owner);
|
467 | 467 |
|
468 | 468 |
/// True if the window is modal
|
469 | 469 |
bool isModal(FXWindow* window) const;
|
52 | 52 |
public:
|
53 | 53 |
|
54 | 54 |
/// Construct splash window
|
55 | |
FXSplashWindow(FXApp* ap,FXIcon* ic,FXuint opts=SPLASH_SIMPLE,FXuint ms=5000);
|
|
55 |
FXSplashWindow(FXApp* a,FXIcon* ic,FXuint opts=SPLASH_SIMPLE,FXuint ms=5000);
|
56 | 56 |
|
57 | 57 |
/// Construct splash window
|
58 | |
FXSplashWindow(FXWindow* ow,FXIcon* ic,FXuint opts=SPLASH_SIMPLE,FXuint ms=5000);
|
|
58 |
FXSplashWindow(FXWindow* own,FXIcon* ic,FXuint opts=SPLASH_SIMPLE,FXuint ms=5000);
|
59 | 59 |
|
60 | 60 |
/// Set the icon for the splash window
|
61 | 61 |
void setIcon(FXIcon* ic);
|
23 | 23 |
|
24 | 24 |
%apply Pointer NONNULL {
|
25 | 25 |
FXApp* APP,
|
26 | |
FXComposite* PARENT,
|
27 | |
FXWindow* OWNER
|
|
26 |
FXApp* a,
|
|
27 |
FXApp* app,
|
|
28 |
FXApp* application,
|
|
29 |
FXComposite* PARENT,
|
|
30 |
FXComposite* p,
|
|
31 |
FXWindow* OWNER,
|
|
32 |
FXWindow* own,
|
|
33 |
FXWindow* owner
|
28 | 34 |
}
|
29 | 35 |
|
30 | 36 |
/* Type-checking rules */
|
20 | 20 |
|
21 | 21 |
def setup
|
22 | 22 |
super(self.class.name)
|
|
23 |
end
|
|
24 |
|
|
25 |
def test_nil_window_raises_argument_error
|
|
26 |
assert_raise(ArgumentError){ app.runPopup(nil) }
|
23 | 27 |
end
|
24 | 28 |
|
25 | 29 |
def check_events(pipe_rd, pipe_wr)
|
7 | 7 |
def setup
|
8 | 8 |
super("TC_FXButton")
|
9 | 9 |
@button = FXButton.new(mainWindow, "buttonText")
|
|
10 |
end
|
|
11 |
|
|
12 |
def test_nil_parent_raises_argument_error
|
|
13 |
assert_raise(ArgumentError){ FXButton.new(nil, "buttonText") }
|
10 | 14 |
end
|
11 | 15 |
|
12 | 16 |
def testText
|
9 | 9 |
vis = FXGLVisual.new(app, VISUAL_DOUBLEBUFFER)
|
10 | 10 |
@viewer = FXGLViewer.new(mainWindow, vis)
|
11 | 11 |
end
|
|
12 |
|
|
13 |
def test_supported
|
|
14 |
assert FXGLVisual.supported?(app)
|
|
15 |
end
|
|
16 |
|
|
17 |
def test_nil_app_raises_argument_error
|
|
18 |
assert_raise(ArgumentError){ FXGLVisual.supported?(nil) }
|
|
19 |
end
|
|
20 |
|
12 | 21 |
=begin
|
13 | 22 |
def test_readPixels
|
14 | 23 |
pixels = @viewer.readPixels(0, 0, @viewer.width, @viewer.height)
|
6 | 6 |
|
7 | 7 |
def setup
|
8 | 8 |
super(self.class.name)
|
|
9 |
end
|
|
10 |
|
|
11 |
def test_nil_app_raises_argument_error
|
|
12 |
assert_raise(ArgumentError){ FXMessageBox.new(nil, "Save?", "Save?", :opts => MBOX_SAVE_CANCEL_DONTSAVE) }
|
9 | 13 |
end
|
10 | 14 |
|
11 | 15 |
def test_construct_with_save_cancel_dontsave
|
7 | 7 |
def setup
|
8 | 8 |
super(self.class.name)
|
9 | 9 |
@scrollArea = FXScrollArea.new(mainWindow)
|
|
10 |
end
|
|
11 |
|
|
12 |
def test_nil_parent_raises_argument_error
|
|
13 |
assert_raise(ArgumentError){ FXScrollArea.new(nil) }
|
10 | 14 |
end
|
11 | 15 |
|
12 | 16 |
def test_position_get
|
14 | 14 |
@mainWin = FXMainWindow.new(@app, 'TC_FXShell')
|
15 | 15 |
end
|
16 | 16 |
|
|
17 |
def test_nil_parent_raises_argument_error
|
|
18 |
assert_raise(ArgumentError){ FXShell.new(nil, 0, 0, 0, 0, 0) }
|
|
19 |
end
|
|
20 |
|
17 | 21 |
def test_new
|
18 | 22 |
# Free-floating
|
19 | 23 |
shell1 = FXShell.new(@app, 0, 0, 0, 0, 0)
|
14 | 14 |
@mainWin = FXMainWindow.new(@app, 'TC_FXButton')
|
15 | 15 |
end
|
16 | 16 |
|
|
17 |
def test_nil_app_raises_argument_error
|
|
18 |
assert_raise(ArgumentError){ FXTopWindow.new(nil, 'TC_FXButton') }
|
|
19 |
end
|
|
20 |
|
17 | 21 |
def test_new
|
18 | 22 |
# Free-floating
|
19 | 23 |
top1 = FXTopWindow.new(@app, "top1", nil, nil, DECOR_ALL, 0, 0, 0, 0,
|