IC8 Python API:RLPy RIDialog
Contents
- 1 Description
- 2 Class Methods
- 2.1 RLPy.RIDialog.GetDialogType(self)
- 2.2 RLPy.RIDialog.GetTitle(self)
- 2.3 RLPy.RIDialog.GetWindow(self)
- 2.4 RLPy.RIDialog.GetWindowTitle(self)
- 2.5 RLPy.RIDialog.IsModal(self)
- 2.6 RLPy.RIDialog.RegisterEventCallback(self, pfCallback )
- 2.7 RLPy.RIDialog.RegisterNativeEventCallback(self, pfCallback )
- 2.8 RLPy.RIDialog.SetModal(self, bModal )
- 2.9 RLPy.RIDialog.SetParent(self, pWidget )
- 2.10 RLPy.RIDialog.SetWindowTitle(self, strTitleName )
- 2.11 RLPy.RIDialog.UnregisterAllEventCallbacks(self)
- 2.12 RLPy.RIDialog.UnregisterEventCallback(self, uId )
- 2.13 RLPy.RIDialog.UnregisterEventCallbacks(self, kIds )
- 2.14 RLPy.RIDialog.UnregisterNativeEventCallback(self, uId )
- 2.15 RLPy.RIDialog.UnregisterNativeEventCallbacks(self, kIds )
- 3 Description
- 4 Constructor & Destructor
- 5 Member Functions
- 5.1 Close (self)
- 5.2 Exec (self)
- 5.3 GetDialogType (self)
- 5.4 GetTitle (self)
- 5.5 GetWindow (self)
- 5.6 GetWindowTitle (self)
- 5.7 Hide (self)
- 5.8 IsModal (self)
- 5.9 IsVisible (self)
- 5.10 RegisterEventCallback (self, pfCallback)
- 5.11 RegisterNativeEventCallback (self, pfCallback)
- 5.12 SetModal (self, bModal)
- 5.13 SetParent (self, pWidget)
- 5.14 SetWindowTitle (self, strTitleName)
- 5.15 Show (self)
- 5.16 UnregisterAllEventCallbacks (self)
- 5.17 UnregisterEventCallback (self, uId)
- 5.18 UnregisterEventCallbacks (self, kIds)
- 5.19 UnregisterNativeEventCallback (self, uId)
- 5.20 UnregisterNativeEventCallbacks (self, kIds)
- 6 Properties
- Main article: iC8 Modules.
- Last modified: 10/21/2026
Description
This class is custom widget dialog. A Dialog is always a top-level widget, but if it has a parent, its default location is centered on top of the parent's top-level widget.
1 class DialogEventCallback(RLPy.RDialogCallback):
2 def __init__(self):
3 RLPy.RDialogCallback.__init__(self)
4
5 def OnDialogShow(self):
6 print("dialog show")
7
8 def OnDialogHide(self):
9 print("dialog hide")
10 def OnDialogClose(self):
11 print("dialog close")
12 return True
13
14 rl_dialog = RLPy.RUi.CreateRDialog()
15 rl_dialog.SetWindowTitle("main_dialog")
16 print(rl_dialog.GetWindowTitle()) # main_dialog
17
18 # register dialog event
19 dialog_event_callback = DialogEventCallback()
20 dialog_register_id = rl_dialog.RegisterEventCallback(dialog_event_callback)
21
22 # use id to unregister
23 rl_dialog.UnregisterEventCallback(dialog_register_id)
24
25 rl_dialog.Show()
26 rl_dialog.IsVisble() # True
27 rl_dialog.Hide()
28 rl_dialog.IsVisble() # False
Class Methods
RLPy.RIDialog.GetDialogType(self)
Return current dialog type.
Returns
dialog type - RLPy.EDialogType
- RLPy.EDialogType_Normal
- RLPy.EDialogType_Exclusive
1 # Get normal RIDialog type
2 rl_normal_dialog = RLPy.RUi.CreateRDialog()
3 rl_normal_dialog.SetWindowTitle("normal_dialog")
4 rl_normal_dialog.Show()
5 normal_dialog_type = rl_normal_dialog.GetDialogType()
6 print(normal_dialog_type)
7
8 # Get exclusive RIDialog type
9 rl_exclusive_dialog = RLPy.RUi.CreateRDialog(RLPy.EDialogType_Exclusive)
10 rl_exclusive_dialog.SetWindowTitle("exclusive_dialog")
11 rl_exclusive_dialog.Show()
12 exclusive_dialog_type = rl_exclusive_dialog.GetDialogType()
13 print(exclusive_dialog_type)
RLPy.RIDialog.GetTitle(self)
Get title bar widget's address.
Returns
Address of the title bar widget - QWidget
1 rl_dialog = RLPy.RUi.CreateRDialog()
2 rl_dialog.SetWindowTitle("main_dialog")
3 print(rl_dialog.GetWindowTitle()) # main_dialog
RLPy.RIDialog.GetWindow(self)
Get dialog's itself address.
Returns
a pointer to the dialog - QWidget
1 # Create RIDialog and add widget to the dialog
2 main_dlg_url = QUrl("...ui path")
3 main_dlg_view = PySide2.QtQuickWidgets.QQuickWidget()
4 main_dlg_view.setSource(main_dlg_url)
5
6 main_rl_dlg = RLPy.RUi.CreateRDialog()
7 main_pyside_dlg = wrapInstance(int(main_rl_dlg.GetWindow()), PySide2.QtWidgets.QDialog)
8 main_pyside_dlg.setObjectName("Main Dialog")
9 main_layout = main_pyside_dlg.layout()
10 main_layout.addWidget(main_dlg_view)
RLPy.RIDialog.GetWindowTitle(self)
Get title bar Name.
Returns
Title bar name - string
1 # Get RIDialog titlebar text
2 main_rl_dlg = RLPy.RUi.CreateRDialog()
3 main_rl_dlg_window_title = rl_dialog.GetWindowTitle()
4 print(main_rl_dlg_window_title)
RLPy.RIDialog.IsModal(self)
Return if dialog is modal or modeless.
Returns
Trueif dialog is modal Falseif dialog is modeless
1 # Get RIDialog modal status
2 main_rl_dlg = RLPy.RUi.CreateRDialog()
3 main_rl_dlg.SetWindowTitle("Main Dialog")
4 main_rl_dlg.SetModal(True)
5 main_rl_dlg.Show()
6 is_dialog_modal = main_rl_dlg.IsModal()
7 print(is_dialog_modal)
RLPy.RIDialog.RegisterEventCallback(self, pfCallback )
Dialog event callback.
Parameters
- pfCallback[IN] dialog event callback pointer - RLPy.RDialogCallback
Returns
Dialog Event callBack id - int
1 RLPy.RIDialog.UnregisterEventCallbacks( self, kIds )
2 # Define RDialogCallback
3 class DialogEventCallback(RLPy.RDialogCallback):
4 def __init__(self):
5 RLPy.RDialogCallback.__init__(self)
6
7 def OnDialogShow(self):
8 print("dialog show")
9
10 def OnDialogHide(self):
11 print("dialog hide")
12
13 def OnDialogClose(self):
14 print("dialog close")
15 return True
16
17 # Register RIDialog event callback
18 rl_dialog = RLPy.RUi.CreateRDialog()
19 rl_dialog.SetWindowTitle("main_dialog")
20 dialog_event_callback = DialogEventCallback()
21 dialog_register_id = rl_dialog.RegisterEventCallBack(dialog_event_callback)
22 print(dialog_register_id)
RLPy.RIDialog.RegisterNativeEventCallback(self, pfCallback )
Windows event callback.
Parameters
- pfCallback[IN] Window message callback pointer - RLPy.RWinMessageCallback
Returns
Windows Event callBack id - int
1 # Define RWinMessageCallback
2 class WinMessageCallback(RLPy.RWinMessageCallback):
3 def __init__(self):
4 RLPy.RWinMessageCallback.__init__(self)
5
6 def OnWinMsgReceieved(self, data):
7 print("window message received")
8
9 # Register RIDialog native event callback
10 rl_dialog = RLPy.RUi.CreateRDialog()
11 rl_dialog.SetWindowTitle("main_dialog")
12 native_event_callback = WinMessageCallback()
13 dialog_register_id = rl_dialog.RegisterNativeEventCallBack(native_event_callback)
14 print(dialog_register_id)
RLPy.RIDialog.SetModal(self, bModal )
Set dialog modal or modeless.
Parameters
- bModal[IN] True is modal or False is modeless - bool
1 # Set RIDialog modal status
2 main_rl_dlg = RLPy.RUi.CreateRDialog()
3 main_rl_dlg.SetWindowTitle("Main Dialog")
4 main_rl_dlg.SetModal(True)
5 main_rl_dlg.Show()
RLPy.RIDialog.SetParent(self, pWidget )
Set the parent of the dialog.
Parameters
- pWidget[IN] Widget pointer - QWidget
1 # Set RIDialog parent window address
2 main_rl_dlg = RLPy.RUi.CreateRDialog()
3 main_rl_dlg.SetParent(RLPy.RUi.GetMainWindow())
RLPy.RIDialog.SetWindowTitle(self, strTitleName )
Set dialog title name.
Parameters
- strTitleName[IN] title name - string
1 # Set RIDialog titlebar text
2 main_rl_dlg = RLPy.RUi.CreateRDialog()
3 main_rl_dlg.SetWindowTitle("test_dialog")
RLPy.RIDialog.UnregisterAllEventCallbacks(self)
Unregister all dialog event callback.
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # Define RDialogCallback 1
2 class DialogEventCallback1(RLPy.RDialogCallback):
3 def __init__(self):
4 RLPy.RDialogCallback.__init__(self)
5
6 def OnDialogShow(self):
7 print("[DialogEventCallback1]dialog show")
8
9 def OnDialogHide(self):
10 print("[DialogEventCallback1]dialog hide")
11
12 def OnDialogClose(self):
13 print("[DialogEventCallback1]dialog close")
14 return True
15
16 # Define RDialogCallback 2
17 class DialogEventCallback2(RLPy.RDialogCallback):
18 def __init__(self):
19 RLPy.RDialogCallback.__init__(self)
20
21 def OnDialogShow(self):
22 print("[DialogEventCallback2]dialog show")
23
24 def OnDialogHide(self):
25 print("[DialogEventCallback2]dialog hide")
26
27 def OnDialogClose(self):
28 print("[DialogEventCallback2]dialog close")
29 return True
30
31 # Unregister RIDialog all event callbacks
32 rl_dialog = RLPy.RUi.CreateRDialog()
33 rl_dialog.SetWindowTitle("main_dialog")
34 dialog_event_callback_1 = DialogEventCallback1()
35 dialog_register_id_1 = rl_dialog.RegisterEventCallBack(dialog_event_callback_1)
36 dialog_event_callback_2 = DialogEventCallback2()
37 dialog_register_id_2 = rl_dialog.RegisterEventCallBack(dialog_event_callback_2)
38 result = rl_dialog.UnregisterAllEventCallbacks()
39 print(result)
RLPy.RIDialog.UnregisterEventCallback(self, uId )
Unregister dialog event callback with Id.
Parameters
- uId[IN] callback id - int
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # Define RDialogCallback
2 class DialogEventCallback(RLPy.RDialogCallback):
3 def __init__(self):
4 RLPy.RDialogCallback.__init__(self)
5
6 def OnDialogShow(self):
7 print("dialog show")
8
9 def OnDialogHide(self):
10 print("dialog hide")
11
12 def OnDialogClose(self):
13 print("dialog close")
14 return True
15
16 # Unregister RIDialog event callback
17 rl_dialog = RLPy.RUi.CreateRDialog()
18 rl_dialog.SetWindowTitle("main_dialog")
19 dialog_event_callback = DialogEventCallback()
20 dialog_register_id = rl_dialog.RegisterEventCallBack(dialog_event_callback)
21 result = rl_dialog.UnregisterEventCallback(dialog_register_id)
22 print(result)
RLPy.RIDialog.UnregisterEventCallbacks(self, kIds )
Unregister dialog event callback with Ids.
Parameters
- kIds[IN] callback ids - int
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # Define RDialogCallback 1
2 class DialogEventCallback1(RLPy.RDialogCallback):
3 def __init__(self):
4 RLPy.RDialogCallback.__init__(self)
5
6 def OnDialogShow(self):
7 print("[DialogEventCallback1]dialog show")
8
9 def OnDialogHide(self):
10 print("[DialogEventCallback1]dialog hide")
11
12 def OnDialogClose(self):
13 print("[DialogEventCallback1]dialog close")
14 return True
15
16 # Define RDialogCallback 2
17 class DialogEventCallback2(RLPy.RDialogCallback):
18 def __init__(self):
19 RLPy.RDialogCallback.__init__(self)
20
21 def OnDialogShow(self):
22 print("[DialogEventCallback2]dialog show")
23
24 def OnDialogHide(self):
25 print("[DialogEventCallback2]dialog hide")
26
27 def OnDialogClose(self):
28 print("[DialogEventCallback2]dialog close")
29 return True
30
31 # Unregister RIDialog event callbacks
32 rl_dialog = RLPy.RUi.CreateRDialog()
33 rl_dialog.SetWindowTitle("main_dialog")
34 dialog_event_callback_1 = DialogEventCallback1()
35 dialog_register_id_1 = rl_dialog.RegisterEventCallBack(dialog_event_callback_1)
36 dialog_event_callback_2 = DialogEventCallback2()
37 dialog_register_id_2 = rl_dialog.RegisterEventCallBack(dialog_event_callback_2)
38 event_handler_list = []
39 event_handler_list.append(dialog_register_id_1)
40 event_handler_list.append(dialog_register_id_2)
41 result = rl_dialog.UnregisterEventCallbacks(event_handler_list)
RLPy.RIDialog.UnregisterNativeEventCallback(self, uId )
Unregister windows event callback with Id.
Parameters
- uId[IN] callback id - int
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # Define RWinMessageCallback
2 class WinMessageCallback(RLPy.RWinMessageCallback):
3 def __init__(self):
4 RLPy.RWinMessageCallback.__init__(self)
5
6 def OnWinMsgReceieved(self, data):
7 print("window message received")
8
9 # Unregister RIDialog native event callback
10 rl_dialog = RLPy.RUi.CreateRDialog()
11 rl_dialog.SetWindowTitle("main_dialog")
12 native_event_callback = WinMessageCallback()
13 dialog_register_id = rl_dialog.RegisterNativeEventCallBack(native_event_callback)
14 result = rl_dialog.UnregisterNativeEventCallback(dialog_register_id)
15 print(result)
RLPy.RIDialog.UnregisterNativeEventCallbacks(self, kIds )
Unregister windows event callback with Ids.
Parameters
- kIds[IN] callback ids - int
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # Define RWinMessageCallback 1
2 class WinMessageCallback1(RLPy.RWinMessageCallback):
3 def __init__(self):
4 RLPy.RWinMessageCallback.__init__(self)
5
6 def OnWinMsgReceieved(self, data):
7 print("[WinMessageCallback1]window message received")
8
9 # Define RWinMessageCallback 2
10 class WinMessageCallback2(RLPy.RWinMessageCallback):
11 def __init__(self):
12 RLPy.RWinMessageCallback.__init__(self)
13
14 def OnWinMsgReceieved(self, data):
15 print("[WinMessageCallback2]window message received2")
16
17 # Unregister RIDialog native event callbacks
18 rl_dialog = RLPy.RUi.CreateRDialog()
19 rl_dialog.SetWindowTitle("main_dialog")
20 native_event_callback_1 = WinMessageCallback1()
21 dialog_register_id_1 = rl_dialog.RegisterNativeEventCallBack(native_event_callback_1)
22 native_event_callback_2 = WinMessageCallback2()
23 dialog_register_id_2 = rl_dialog.RegisterNativeEventCallBack(native_event_callback_2)
24 event_handler_list = []
25 event_handler_list.append(dialog_register_id_1)
26 event_handler_list.append(dialog_register_id_2)
27 result = rl_dialog.UnregisterNativeEventCallbacks(event_handler_list)
28 print(result)
Description
Provides dialog UI related functions such as creating dialog windows and dialog related properties. It also allows the registration and unregistration of dialog callback events.
Constructor & Destructor
__init__ (self, *args, **kwargs)
Initializes a new ri dialog instance.
Parameters
- args
- kwargs
Member Functions
Close (self)
Close this dialog window and release it from memory. See Also: Show, Hide
Exec (self)
Executes this dialog and returns its result.
GetDialogType (self)
Get the type of this dialog, which is either normal or exclusive. Multiple instances of normal dialog windows can exists at the same time, while there can only be one instance of exclusive dialog at any given time.
GetTitle (self)
Get this dialog's title-bar QWidget address, which can be used to apply PySide operations.
GetWindow (self)
Get the QWidget address of this dialog, which can be used to create a PySide representation and later accommodate a Qt ui or qml file.
GetWindowTitle (self)
Get the title-bar label text for this dialog. See Also: SetWindowTitle
Hide (self)
Hide this dialog but keep it in system memory. See Also: Show, Close
IsModal (self)
Check whether if this dialog is a modal window. See Also: SetModal
IsVisible (self)
Check whether if this dialog is visible or not. See Also: Show, Hide, Close
RegisterEventCallback (self, pfCallback)
Register a RDialogCallback to this dialog and return its id. See Also: UnregisterEventCallback, UnregisterEventCallbacks
Parameters
- pfCallback
RegisterNativeEventCallback (self, pfCallback)
Register a RWinMessageCallback event with this dialog and return its id. See Also: UnregisterNativeEventCallback, UnregisterNativeEventCallbacks
Parameters
- pfCallback
SetModal (self, bModal)
Set the modal state for this dialog. A modal dialog forces the application to focus on it, whereupon only operations within the dialog are allowed, until it is closed. See Also: IsModal
Parameters
- bModal
SetParent (self, pWidget)
Set the parent widget for this dialog according to the input window address. When the parent widget is closed, its child widget is also closed. Currently, only the main window is supported as the parent widget.
Parameters
- pWidget
SetWindowTitle (self, strTitleName)
Set the title-bar label text for this dialog. See Also: GetWindowTitle
Parameters
- strTitleName
Show (self)
Display this dialog (make it visible). See Also: Hide, Close
UnregisterAllEventCallbacks (self)
Unregister all event callbacks from this dialog. See Also: RegisterEventCallback, UnregisterEventCallback, UnregisterEventCallbacks
UnregisterEventCallback (self, uId)
Unregister a RDialogCallback from this dialog according to its id. See Also: RegisterEventCallback, UnregisterEventCallbacks
Parameters
- uId
UnregisterEventCallbacks (self, kIds)
Unregister a collection of RDialogCallback from this dialog according to the given ids. If one of the events fails to unregister, it will not affect subsequent unregistering. See Also: RegisterEventCallback, UnregisterEventCallback
Parameters
- kIds
UnregisterNativeEventCallback (self, uId)
Unregister RWinMessageCallback event from this dialog. See Also: RegisterNativeEventCallback, UnregisterNativeEventCallbacks
Parameters
- uId
UnregisterNativeEventCallbacks (self, kIds)
Unregister a collection of RWinMessageCallback from this dialog. If one of the events fails to unregister, it will not affect subsequent unregistering. See Also: RegisterNativeEventCallback, UnregisterNativeEventCallback
Parameters
- kIds
Properties
thisown
Indicates whether this SWIG proxy owns the underlying C++ object.