buttons disappear after redrawing and show up again when mouse moved in - button

dear Sirs:
I am using wxPython to draw some window background and buttons.
I redrew the background panel with memoryDC and then save the background image to staticbitmap.
I also declared some buttons on top of the background window.
When I redrew the background, the buttons just disappear.
Then when I moved the cursor across those buttons, they appear again.
I tried to Raise() the buttons.
But that did not work.
The solution now is to destroy the buttons and then re-instantiate them again after redrawing the background of the windows.
But is there any more efficient way to do this without having to reconstruct the button objects.
Thanks
Farn

Mike Driscoll posted a nice example for background bitmap in wxPython in his blog. Note the code update at the end of his post required for Versions >= 2.9.

Related

How to create an gradient button with colored shadow

I'm kind of noobie in Flutter and I'm trying to learn it for the moment by creating different UI styles for whatever applications. But I encounter a problem in terms of designing a button.
WHAT I WANT TO DO:
WHAT I TRIED:
Using a GradientButton:
I can't change the rounded corners to not be that rounded.
I can't change the size of the button dynamically based on the size of text
I can't change the shadow of the box
Using a RaisedButton in combination with a Container:
If I will tap the button is going to show a gray box which was clicked on, but this box is not going to have the same size or shape with the box, so it's going to look weird.
Using an InkWell in combination with a Container:
I'm not quite sure but I can't do the click animation with that, is like I'm pressing on nothing, even those the action is happening.
If you do have any idea how can I archive this button please let me know, for me at the moment at least is the most complicated button I've ever seen.
see the source code at github
https://github.com/bluemix/Gradient-Widgets/blob/master/lib/src/gradient_button.dart
You can use Container to custom button gradient and add GestureDetector or InkWell to onTap handle action.
GestureDetector will have no effect. InkWell will have effect.

qml: achieve a chrome-like menu

I would like to achieve with QML a menu with a single menu item, like chrome does it. It has this button with those three horizontal bars and when you click it you get a single menu. Recent versions of firefox also follow the same principle. It allows not to waste too much horizontal space in the GUI of the application, unline usual menus which take up the whole width of the window.
I did not manage to reproduce exactly this GUI with QML. From what I saw you can either use a QML ApplicationWindow, and then a MenuBar, but then it takes the whole width of the window... Or have a toggle button to trigger the menu, then use a standalone Menu and its popup() method, but then it pops-up directly under the cursor, not exactly under the button to open the menu, which doesn't look good. That's really more abusing the mechanism for a context menu.
I could make a fake menu which would be a custom widget in my window but then it could not expand beyond my application window. Such a behaviour is almost required because I'll put this button on the far right of the window, as chrome does it.
Is it possible to achieve exactly that behaviour in pure QML (no C++)?
What I did for now is the last option that I mentioned: fake menu in the window. It's drawing using the canvas which enables me to make it a little pointy arrow from the menu to the menu toggle button, as done also by firefox.
The minus as I said is that the menu cannot go out of the window, plus everything is very manual (mouseover effect for menu items...), so I'm still interested in other solutions.
EDIT: ok after some time I realized a big plus of my approach: I can put custom widgets, not only labels in the menu. So I think it's absolutely the right approach now.

iPad SplitView Master View shows but with minor (and incorrect) variation

I'm practicing development of a simple iPad Split View app (Stanford's Hegarty online class). And everything works for the most part. However, the Master side ('left side), although working in landscape mode looks a little different than what I expect it to as a 'popover' in portrait mode. The 'popover' covers the left side of the screen including the toolbar button item that triggered it where normally it should not cover that button.
Unfortunately I can't post images so I'll try my best to describe in more detail. Normally the 'proper' popover will be hovering right below the bar item button that triggered it with a thick arrow-ish thingie (the 'anchor') pointing to the button and not covering that button. The popover can be dismissed by clicking on that button again (or elsewhere on the screen).
What's happening to me, however, is that when I click the bar item button to show the popover, the resulting popover 'covers' the button and essentially fills up the left portion of the screen (the detail view is under it and most of it is showing) with its designated width (so, again, it doesn't cover the entire detail view). The is no 'anchor' arrow pointing to the bar item button since it is obviously covering it instead. The popover is dismissed normally once I click anywhere else on the screen.
So why is my popover covering the button and not simply hovering under it with an 'anchor' pointing to it as it should?
I don't think it it makes much sense to post code at this point because I don't think it'll help and more importantly not sure what portion to post considering this might be a problem with how I wired it in the Builder. Any thoughts will be greatly appreciated!
Thanks!
Mo
I believe its a change that came in IOS5.1
If you want the same behaviour you probably need to set the master up as a popover segue, from a toolbar button or similar in the detail view, and set the split view delegate to not show the master in portrait.
I'm on the move now but if you want any more info let me know and I'll try and get back to you later.

Qt radio button switch display delay

I'm having a Qt application here where I have a main window with 5 QPushButtons that are aligned vertically.
These buttons work in a radio-group manner.
This means, that they are checkable and auto-exclusive.
Since I need to be able to resize the font size of the button text when the main window resizes, I included my own override of QPushButton and set it as custom widget in designer.
What I don't understand is, that there is a heavy delay when I switch from one button to another via keyboard shortcuts! Same when I click with the mouse.
I would say that this delay is about 0.5 to 1 second.
Have tried it on different machines.
I really need to get rid of this!
Anyone has an idea of what I could do to fix this??
Edit : Just found out that this behavior is the same when I just use normal QPushButtons. It seems that the delay is getting more when the buttons are getting bigger. Any help is strongly appreciated!!!
A shot in the dark: Setting the font might cause another resizeEvent, which in turn causes another one and so on... Try putting the font adjustment code into a method that you explicitly call when you enter/leave full screen mode.

Animated auto-hide ApplicationControlBar

Anyone know how to create animated auto-hide on ApplicationControlBar just like Windows's taskbar?
I'm totally new on this.
Thanks.
The issue with doing this is that on Windows, you have a 'lower bound'--also known as the bottom of the screen which is used to trigger the display of the task bar based on the mouse location.
In a browser based app, you don't have that spot which is easy for the user to roll their mouse over.
That said, if you're still adamant, you should be able to put something together easily using the mouse over events to swap the visibility of the ApplicationControlBar and then you can use show / hide effects to display the control bar.

Resources