Skip to content

Commit

Permalink
1.1.2
Browse files Browse the repository at this point in the history
- `WindowBase`:
  - `destroy`: returns `bool` and warns failed calls.
  • Loading branch information
gmpassos committed Aug 10, 2023
1 parent f8934ec commit 401b94d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,8 @@
## 1.1.2

- `WindowBase`:
- `destroy`: returns `bool` and warns failed calls.

## 1.1.1

- `WindowClassColors`:
Expand Down
4 changes: 1 addition & 3 deletions lib/src/win32_dialog.dart
Expand Up @@ -309,9 +309,7 @@ class Dialog<R> extends WindowBase<Dialog> {
final timeout = this.timeout;
if (timeout == null) return;

_timeoutTimer = Timer(timeout, () {
_notifyTimeout();
});
_timeoutTimer = Timer(timeout, _notifyTimeout);
}

bool _timeoutTriggered = false;
Expand Down
13 changes: 11 additions & 2 deletions lib/src/win32_gui_base.dart
Expand Up @@ -850,10 +850,19 @@ abstract class WindowBase<W extends WindowBase<W>> {

/// Destroys this [Window].
/// - Calls Win32 [DestroyWindow].
void destroy() {
bool destroy() {
final hwnd = this.hwnd;

DestroyWindow(hwnd);
var r = DestroyWindow(hwnd);
if (r == 0) {
final errorCode = GetLastError();
_logWindow.warning(
"Error closing `Window`> errorCode: $errorCode > $hwnd -> $this");

return false;
}

return true;
}

/// Shows a message dialog.
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
@@ -1,6 +1,6 @@
name: win32_gui
description: Win32 API GUI in Object-Oriented style with some helpers. Uses package `win32` and `dart:ffi`.
version: 1.1.1
version: 1.1.2
repository: https://github.com/gmpassos/win32_gui

screenshots:
Expand Down

0 comments on commit 401b94d

Please sign in to comment.