Skip to content

Commit 0ba779a

Browse files
committed
Merge branch 'master' of https://github.com/hoffstadt/DearPyGui
2 parents 231fad3 + e536cc8 commit 0ba779a

8 files changed

Lines changed: 49 additions & 37 deletions

File tree

docs/source/documentation/io-handlers-state.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Handlers can be activated or deactivated by showing or hiding them.
1111
Handlers are required to be added to a handler registry.
1212

1313
Item Handlers
14-
----------------
14+
-------------
1515

1616
Item handlers listen for states related to a specific item.
1717

docs/source/documentation/item-callbacks.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ app_data:
4141
print(f"app_data is: {app_data}")
4242
4343
with dpg.window(label="Tutorial"):
44-
dpg.add_button(label="Apply", callback=button_callback)
44+
dpg.add_button(label="Print to Terminal", callback=button_callback)
4545
4646
dpg.create_viewport(title='Custom Title', width=800, height=600)
4747
dpg.setup_dearpygui()
@@ -75,10 +75,10 @@ User data can be any python object.
7575
7676
with dpg.window(label="Tutorial"):
7777
# user data set when button is created
78-
dpg.add_button(label="Apply", callback=button_callback, user_data="Some Data")
78+
dpg.add_button(label="Print to Terminal", callback=button_callback, user_data="Some Data")
7979
8080
# user data and callback set any time after button has been created
81-
dpg.add_button(label="Apply 2", tag="btn")
81+
dpg.add_button(label="Print to Terminal 2", tag="btn")
8282
dpg.set_item_callback("btn", button_callback)
8383
dpg.set_item_user_data("btn", "Some Extra User Data")
8484

docs/source/documentation/item-id-system.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ be done at run time, is anonymous or sometimes just for convenience.
100100
101101
with dpg.window(label="Example"):
102102
with dpg.group():
103-
dpg.add_button(label="Press me")
103+
dpg.add_button(label="View the Terminal for item tags")
104104
print(dpg.last_item())
105105
print(dpg.last_container())
106106
print(dpg.last_root())

docs/source/documentation/popups.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Normally when used, a popup will be shown until you click away from it.
1212
By default, a right click activates the popup.
1313

1414
**Code**
15+
1516
.. code-block:: python
1617
1718
import dearpygui.dearpygui as dpg

docs/source/documentation/tables.rst

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,11 @@ You can also set the sizing policy
166166
keyword, `policy`, using the following options
167167

168168

169-
| Policy |
170-
| ---- |
171-
| mvTable_SizingFixedFit |
172-
| mvTable_SizingFixedSame |
173-
| mvTable_SizingStretchProp |
174-
| mvTable_SizingStretchSame |
169+
Policy:
170+
| mvTable_SizingFixedFit
171+
| mvTable_SizingFixedSame
172+
| mvTable_SizingStretchProp
173+
| mvTable_SizingStretchSame
175174
176175
Stretch
177176
-------
@@ -405,10 +404,10 @@ the effect on the framerate listed in metrics.
405404
for i in range(5):
406405
dpg.add_table_column()
407406
408-
for i in range(7000):
409-
with dpg.table_row():
410-
for j in range(5):
411-
dpg.add_text(f"Row{i} Column{j}")
407+
for i in range(30000):
408+
with dpg.table_row():
409+
for j in range(5):
410+
dpg.add_text(f"Row{i} Column{j}")
412411
413412
dpg.show_metrics()
414413

docs/source/tutorials/dpg-structure.rst

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,19 @@ All DPG apps must do 3 things:
1919
* Create & Show Viewport
2020
* Setup & Start DearPyGui
2121

22+
The Context
23+
-----------
24+
25+
To access any DPG commands the context must be created with :py:func:`create_context <dearpygui.dearpygui.create_context>`
26+
This should be the first DPG command and it's typical to perform this with an import.
27+
28+
Proper clean up of DPG can be done using :py:func:`destroy_context <dearpygui.dearpygui.destroy_context>`.
29+
2230
Creating and destroying the context and also setup and start dearpygui
2331
are useful when the DPG needs to be started and stopped multiple times in one python session.
2432

25-
.. warning:: Creating the context must be the first call to DPG or DPG will not start (and will probably crash).
33+
.. warning:: If :py:func:`create_context <dearpygui.dearpygui.create_context>`
34+
is not first DPG will not start (and will probably crash).
2635

2736
The Viewport
2837
------------
@@ -65,7 +74,8 @@ The render loop is completely handled
6574
by the :py:func:`start_dearpygui <dearpygui.dearpygui.start_dearpygui>` command.
6675

6776
In some cases it's necessary to explicitly create
68-
the render loop so you can call python commands that may need to run every frame.
77+
the render loop so you can call python commands that may need to run every frame.
78+
Such as per-frame ticker or counter update functions.
6979

7080
**Code:**
7181

@@ -96,26 +106,27 @@ the render loop so you can call python commands that may need to run every frame
96106
97107
.. warning:: The manual render loop must be created after :py:func:`start_dearpygui <dearpygui.dearpygui.start_dearpygui>`
98108

99-
.. seealso:: for more information on the render loop :doc:`../documentation/render-loop`
109+
.. seealso:: For more information on the render loop :doc:`../documentation/render-loop`
100110

101-
Items
102-
---------
111+
Item Overview
112+
-------------
103113

104114
DPG can be broken down into **Items**, **UI Items**, **Containers**
105115

106116
Items:
107117
Items are anything in the library (i.e. button, registries, windows, ect).
108118

109119
UI Items:
110-
Any item in dpg that has a visual component (i.e. button, listbox, window, ect).
120+
Any item in DPG that has a visual component (i.e. button, listbox, window, ect).
111121

112122
Containers:
113-
Items that can hold other items. A root container is a container that has no parent container.
123+
Items that can hold other items. (i.e. window, groups, registries, ect).
114124

115125
The Primary Window
116126
------------------
117127

118-
DPG can assign one window to be the *primary window*, which will fill the
128+
DPG can assign one window to be the *primary window*.
129+
The primary window will fill the
119130
viewport and always be drawn behind other windows.
120131

121132
**Code:**

docs/source/tutorials/first-steps.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Confirm the pip install by runing the code block below.
2828
import dearpygui.dearpygui as dpg
2929
3030
dpg.create_context()
31-
dpg.create_viewport(title='Custom Title', width=600, height=200)
31+
dpg.create_viewport(title='Custom Title', width=600, height=300)
3232
3333
with dpg.window(label="Example Window"):
3434
dpg.add_text("Hello, world")
@@ -60,7 +60,7 @@ The code for this can be found in the repo in the `demo.py`_ file
6060
import dearpygui.demo as demo
6161
6262
dpg.create_context()
63-
dpg.create_viewport(title='Custom Title', width=600, height=200)
63+
dpg.create_viewport(title='Custom Title', width=600, height=600)
6464
6565
demo.show_demo()
6666

docs/source/tutorials/item-usage.rst

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@ Creating Items
99

1010
Items are created using their *add_\*\*\** commands.
1111

12-
All items must have a unique tag which can either be specified by the keyword argument *tag*
13-
or are automatically generated by DPG.
12+
All items must have a tag which can either be specified or are automatically generated by DPG.
1413

15-
The *tags* can be either integers or strings and are
14+
*Tags* can be either integers or strings and are
1615
used to refer to the item after it has been created.
1716

18-
All items return their tag when they are created.
17+
Items return their tag when they are created.
1918

2019
.. warning::
21-
Item tags shall be unique if specified using the *tag* keyword.
20+
Item tags must be unique if specified using the *tag* keyword.
2221
Integers 0-10 are reserved for DPG internal items.
2322

2423
.. code-block:: python
@@ -102,7 +101,7 @@ Each of these can be accessed by their corresponding function
102101
:py:func:`get_item_info <dearpygui.dearpygui.get_item_info>`
103102
keywords that reflect its information (item type, children, theme, ect)
104103

105-
.. note:: configuration, state and info have been broken into
104+
.. note:: configuration, state and info are been broken into
106105
separate commands that access each individual keyword,
107106
instead of returning the entire dictionary.
108107

@@ -157,10 +156,6 @@ an item is created or at a later runtime using
157156

158157
Callbacks may have up to 3 arguments in the following order.
159158

160-
.. note:: Because they are optional positional arguments you
161-
must use the *sender* and *app_data* if you want to use *user_data*
162-
standard keyword arguments:
163-
164159
sender:
165160
the *id* of the UI item that submitted the callback
166161

@@ -170,6 +165,10 @@ app_data:
170165
user_data:
171166
any python object you want to send to the function
172167

168+
.. note:: Because they are optional positional arguments you
169+
must use the *sender* and *app_data* if you want to use *user_data*
170+
standard keyword arguments
171+
173172
**Code:**
174173

175174
.. code-block:: python
@@ -258,6 +257,7 @@ setting a callback to the items and printing their values.
258257
259258
.. image:: https://raw.githubusercontent.com/Atlamillias/DearPyGui-Stuff/main/wiki%20images/dpg_using_widgets_ex1.png
260259

260+
261261
An input item's value is changed by interacting with it.
262262
In the above example, moving slider_float1 slider to 30.55 sets its' value to 30.55.
263263

@@ -287,14 +287,15 @@ We can set the position of the slider by changing items' value at runtime using
287287
288288
.. image:: https://raw.githubusercontent.com/Atlamillias/DearPyGui-Stuff/main/wiki%20images/dpg_using_widgets_ex2.png
289289

290+
290291
.. note::
291292
The values' type depends on the widget. (ex.) input_int default value needs to be an integer.
292293

293294
.. seealso::
294295
For more information on item values :doc:`../documentation/item-value`
295296

296-
Item Handlers
297-
-------------
297+
Using Item Handlers
298+
-------------------
298299

299300
UI item handlers listen for events (changes in state) related to a UI item then submit a callback.
300301

0 commit comments

Comments
 (0)