Overriding Tkinter “X” button control (the button that close the window) [duplicate]

It sounds as if your save window should be modal. If this is a basic save window, why are you reinventing the wheel? Tk has a tkFileDialog for this purpose. If what you want is to override the default behaviour of destroying the window, you can simply do: root.protocol(‘WM_DELETE_WINDOW’, doSomething) # root is your root … Read more

Add UIActivityIndicatorView into UIBarButton

If you’re trying to show the activity wheel in a navigation bar button (e.g. you might have a refresh button on your navbar) – you can create a new UIBarButtonItem with a custom view being the UIActivityIndicatorView: Objective-C uiBusy = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; uiBusy.hidesWhenStopped = YES; [uiBusy startAnimating]; [self.navigationItem.rightBarButtonItem initWithCustomView:uiBusy]; Swift let uiBusy = UIActivityIndicatorView(activityIndicatorStyle: … Read more

Programming In C + Win API: How To Get Windows 7 Look For Controls?

That’s how the controls looked back in the 1990s, before themes (visual styles) were invented. As you’ve noticed, modern buttons are now painted all fancy-pants with gradients and throbbing and all that. But for backwards-compatibility reasons, you have to specifically request that your controls get that treatment, or they’ll fall back to the legacy style. … Read more

tech