Is there such a thing as onBlur on ion segment button? - ionic-framework

I was wondering if there is such a thing as onBlur for ion segment buttons, as I need the functionality of it. I need to change a property to true on a button click and change the property of the button that was deselected to false. How would I be able to do that?

Nope, there is no ionBlur on ion segment, instead it has ionChange event which you can use.

Related

Disable radio buttons contained in Box

I have a set of radio buttons that are placed within a box.
When the user selects an option, these buttons needs to be disabled. I cannot find a relevant property to disable all items within the box.Only option I can find is to set the hidden property.
box.isHidden=true
NSButton inherts from NSControl, which has an isEnabled property. If you want your radio buttons to still be visible but not clickable, use that.

How to disable UIToolbar flexible space item clicks

I have a UIToolBar with some button items on it separated by a flexible space item.
Depending on the state of the app, some buttons are enabled or disabled. And when this happens, when the disabled button is clicked, instead of doing nothing, it sends the "click" event to other button item.
I then understood that this is a default behavior for the toolbar (or the flexible space item?): when you touch an empty space on it, it forwards the event to the closest button. However this is not very good for usability in my application.
Setting enabled OFF to the flexible space item does not change anything at all, and removing UserInteraction from the whole toolbar will make all buttons untouchable.
Is there any way to prevent this "click event forwarding" and simply ignore the touches on empty spaces or disabled buttons ?
Thanks in advance
Well for anyone who wants to know, i couldn't do anything to solve it, you'd better do a better work with your ui.

How to disable focus grabbing for GTK+ tool button

GTK+ Button widget has focus_on_click property that controls grabbing of focus. But I use MenuToolButton that has no such a property. I don't want the focus on click.
How to get rid of it? Thanks!
If you don't want focus_on_click, you probably don't want focus gererally.
widget.set_can_focus(False)

how to make radio button and checkbox button in iphone?

Can anybody tell me the code to make radio button and checkbox button in iphone.
Thanks in advance.
Unless you really want to provide the users with a non-standard experience and invent your own controls (which are likely to not be so fine-tuned as those provided out-of-the-box), i would go with UISwitch instead of checkbox and UIPickerView instead of a radiobutton(s)
You have to do it manually by using UIButtons:
Checkbox: create two images, assign one via setImage:forState: with state UIControlStateNormal, the other with state UIControlStateSelected. Then you can toggle the images simply by setting the button's selected property to NO or YES.
Radiobox: same as with checkbox, but you have to keep track of the other radioboxes (e.g. via an array) and set foo.selected = NO for all the not-selected checkboxes.
#Nitin in these cases you have to use the images in UIImageView for checked or unchecked....basically they are images or one more procedure is to use the custom UIButton and give them images accordingly to situation

Is there a way to uncheck all radio buttons in a group? (PyGTK)

Is there a way to uncheck all radio buttons in a group with PyGTK? No radio buttons are checked on startup, so I think there must be a way to return them all to that unchecked state.
I agree with Michael, but for the record this can be done.
One way to do this would be to have a hidden radio button that you could activate, which would then cause all the visible ones to be inactive. Quick n' Dirty example:
import gtk
window = gtk.Window()
window.set_default_size(200, 200)
rb1 = gtk.RadioButton()
rb2 = gtk.RadioButton()
rb3 = gtk.RadioButton()
rb2.set_group(rb1)
rb3.set_group(rb2)
rb3.set_active(True)
hbox = gtk.HBox()
hbox.add(rb1)
hbox.add(rb2)
hbox.add(rb3)
button = gtk.Button("Click me")
button.connect("clicked", lambda x: rb3.set_active(True))
hbox.add(button)
window.add(hbox)
window.show_all()
rb3.hide()
gtk.main()
There shouldn't be. By their nature, a radio button group is a 'pick one of many' type of control. From a human perspective, the idea is that one of them is always selected. The framework really should enforce that, so there really shouldn't be a 'none selected' state for the group. The none-selected state of a radio button group (in frameworks where it's possible) is very confusing to users, because that's not a state that they can get the control into.
If you want a 'none selected' state, I'd say you should add a 'none' element to the group, OR chose a different control type that conforms to what you want to do with it.
Looked it up in the source code and set_active simply simulates a click on the button if the new state is different from the old one. The radio button code then checks to see if there is another radio button in the group active and if not, it refuses to change as you noticed.
From what it looks the first radio button should always be set to active when you create the group (as expected). If it doesn't show it is likely a bug, it would be interested to see if radio_button.get_active is True for the first button you create (even if it doesn't show up in the UI).
I agree with Michael Kohne though that you should look into another UI element if you want to make all the radio buttons unselected.
My solution, which is notably not encouraged, Is to have a radio button in the same group that isn't shown on screen.
In Glade you can 'add widget as toplevel' in the context menu of the widget add button. In code I would imaging it's basically just don't add the widget to any displayed gui, or carefully don't .show() it (including .showall() on a parent)