ncruces / zenity

Zenity dialogs for Golang, Windows, macOS
https://pkg.go.dev/github.com/ncruces/zenity
MIT License
736 stars 37 forks source link

Not interactable progress dialog #62

Closed Hoto-Cocoa closed 1 year ago

Hoto-Cocoa commented 1 year ago

I'm creating a windows application that act as like Kiosk. We want show progress dialog to user to show payment processing progress, However It should not be able close by user interaction.

However, Zenity's Progress dialog is doesn't have options to do that.

Adding option or type to do this requirement would be nice.

Thanks.

ncruces commented 1 year ago

Did you already try NoCancel?

Hoto-Cocoa commented 1 year ago

Yes, I tried. But It shows Close button on menu bar and shows disabled OK button.

Hoto-Cocoa commented 1 year ago
zenity.Progress(zenity.Title("Payment"), zenity.NoCancel())

This code displays below dialog, And the close button works. I want remove close button and OK button.

image

ncruces commented 1 year ago

I don't think that's supported by zenity which this tries to emulate.

But let me think if the extension makes sense. For starters, --auto-close could make the disabled OK button go away. I need to think through the close button (compare with other platforms).

ncruces commented 1 year ago

zenity hides the OK button if both --auto-close and --no-cancel are specified.

I'll try to implement at least that, for compatibility, but I need to think this through (API and implementation). Auto closing was left for the user of the package to implement.

It'll take some time.

ncruces commented 1 year ago

This should be "fixed" in head.

If you specify both zenity.AutoClose() and zenity.NoCancel() none of the buttons show up, on both Windows and Linux.

On Windows, the dialog still has the close button in the title bar, which is harder (but possible) to remove. I'm not sure I want to fix this, since it's against UX guidelines.

On macOS, it is impossible to remove the Stop button altogether.

I'll close the issue once released.