We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can I call GenericDialog confirm function by pressing Enter key? Like we can do with InputDialog.
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Hello @dovydasz ,
Here is an example for you:
import remi.gui as gui from remi import start, App class MyApp(App): def main(self): # creating a container VBox type, vertical (you can use also HBox or Widget) self.main_container = gui.VBox(width=300, height=200, style={'margin': '0px auto'}) bt = gui.Button("Open dialog") bt.onclick.do(self.on_bt_clicked) self.main_container.append(bt) # returning the root widget return self.main_container def on_bt_clicked(self, emitter): #show dialog and focus confirm_button self.dialog = gui.GenericDialog(title='Dialog Box', message='Ok button is focused, you can type Enter.', width='500px') self.dialog.confirm_dialog.do(self.dialog_confirm) self.dialog.show(self) self.execute_javascript(f"document.getElementById('{self.dialog.children['buttons_container'].children['confirm_button'].identifier}').focus();") def dialog_confirm(self, emitter): print("dialog confirmed") if __name__ == "__main__": # starts the webserver start(MyApp, address='0.0.0.0', port=0, start_browser=True)
In this example, after showing the dialog we trigger the focus on the confirm_button.
Kind Regards ;-)
Sorry, something went wrong.
No branches or pull requests
Can I call GenericDialog confirm function by pressing Enter key? Like we can do with InputDialog.
Thanks in advance!
The text was updated successfully, but these errors were encountered: