New Udemy Coupon. Added Listbox.set_index_color and Listbox.select_index to the SDK Call Reference

This commit is contained in:
PySimpleGUI 2023-08-20 17:20:05 -04:00
parent 2ece7d4ad5
commit 393050c1ae
9 changed files with 99 additions and 19 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/python3 #!/usr/bin/python3
version = __version__ = "4.61.0.194 Unreleased" version = __version__ = "4.61.0.195 Unreleased"
_change_log = """ _change_log = """
Changelog since 4.60.0 released to PyPI on 8-May-2022 Changelog since 4.60.0 released to PyPI on 8-May-2022
@ -460,6 +460,8 @@ _change_log = """
Fixed spelling errors... resuse should have been reuse Fixed spelling errors... resuse should have been reuse
4.61.0.194 4.61.0.194
Added Listbox.select_index and Listbox.set_index_color Added Listbox.select_index and Listbox.set_index_color
4.61.0.195
New Udemy Coupon
""" """
@ -26779,7 +26781,7 @@ def main():
elif event == 'Get Text': elif event == 'Get Text':
popup_scrolled('Returned:', popup_get_text('Enter some text', keep_on_top=True)) popup_scrolled('Returned:', popup_get_text('Enter some text', keep_on_top=True))
elif event.startswith('-UDEMY-'): elif event.startswith('-UDEMY-'):
webbrowser.open_new_tab(r'https://www.udemy.com/course/pysimplegui/?couponCode=9AF99B123C49D51EB547') webbrowser.open_new_tab(r'https://www.udemy.com/course/pysimplegui/?couponCode=62A4C02AB0A3DAB34388')
elif event.startswith('-SPONSOR-'): elif event.startswith('-SPONSOR-'):
if webbrowser_available: if webbrowser_available:
webbrowser.open_new_tab(r'https://www.paypal.me/pythongui') webbrowser.open_new_tab(r'https://www.paypal.me/pythongui')
@ -26787,7 +26789,7 @@ def main():
if webbrowser_available: if webbrowser_available:
webbrowser.open_new_tab(r'https://www.buymeacoffee.com/PySimpleGUI') webbrowser.open_new_tab(r'https://www.buymeacoffee.com/PySimpleGUI')
elif event in ('-EMOJI-HEARTS-', '-HEART-', '-PYTHON HEARTS-'): elif event in ('-EMOJI-HEARTS-', '-HEART-', '-PYTHON HEARTS-'):
popup_scrolled("Oh look! It's a Udemy discount coupon!", '9AF99B123C49D51EB547', popup_scrolled("Oh look! It's a Udemy discount coupon!", '62A4C02AB0A3DAB34388',
'A personal message from Mike -- thank you so very much for supporting PySimpleGUI!', title='Udemy Coupon', image=EMOJI_BASE64_MIKE, keep_on_top=True) 'A personal message from Mike -- thank you so very much for supporting PySimpleGUI!', title='Udemy Coupon', image=EMOJI_BASE64_MIKE, keep_on_top=True)
elif event == 'Themes': elif event == 'Themes':
search_string = popup_get_text('Enter a search term or leave blank for all themes', 'Show Available Themes', keep_on_top=True) search_string = popup_get_text('Enter a search term or leave blank for all themes', 'Show Available Themes', keep_on_top=True)

View File

@ -25,9 +25,9 @@
<span style="font-weight: normal;"> <span style="font-weight: normal;">
apply coupon for discount: apply coupon for discount:
</span> </span>
9AF99B123C49D51EB547. 62A4C02AB0A3DAB34388.
</div> </div>
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=9AF99B123C49D51EB547','_blank');"> <button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=62A4C02AB0A3DAB34388','_blank');">
click here to visit course page click here to visit course page
</button> </button>
</div> </div>
@ -5583,6 +5583,24 @@ Metadata is an Element property that you can use at any time to hold any value
|---|---|---| |---|---|---|
|(Any)| **return** | the current metadata value | |(Any)| **return** | the current metadata value |
### select_index
Selects an index while providing capability to setting the selected color for the index to specific text/background color
```
select_index(index,
highlight_text_color = None,
highlight_background_color = None)
```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| int | index | specifies which item to change. index starts at 0 and goes to length of values list minus one |
| str | highlight_text_color | color of the text when this item is selected. |
| str | highlight_background_color | color of the background when this item is selected |
### set_cursor ### set_cursor
Sets the cursor for the current Element. Sets the cursor for the current Element.
@ -5616,6 +5634,24 @@ Parameter Descriptions:
|--|--|--| |--|--|--|
| bool | force | if True will call focus_force otherwise calls focus_set | | bool | force | if True will call focus_force otherwise calls focus_set |
### set_index_color
Sets the color of a specific item without selecting it
```
set_index_color(index,
text_color = None,
background_color = None)
```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| int | index | specifies which item to change. index starts at 0 and goes to length of values list minus one |
| str | text_color | color of the text for this item |
| str | background_color | color of the background for this item |
### set_size ### set_size
Changes the size of an element to a specific size. Changes the size of an element to a specific size.

View File

@ -25,9 +25,9 @@
<span style="font-weight: normal;"> <span style="font-weight: normal;">
apply coupon for discount: apply coupon for discount:
</span> </span>
F988F082A3D18483B1C5 62A4C02AB0A3DAB34388
</div> </div>
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=F988F082A3D18483B1C5','_blank');"> <button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=62A4C02AB0A3DAB34388','_blank');">
click here to visit course page click here to visit course page
</button> </button>
</div> </div>

View File

@ -25,9 +25,9 @@
<span style="font-weight: normal;"> <span style="font-weight: normal;">
apply coupon for discount: apply coupon for discount:
</span> </span>
9AF99B123C49D51EB547 62A4C02AB0A3DAB34388
</div> </div>
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=9AF99B123C49D51EB547','_blank');"> <button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=62A4C02AB0A3DAB34388','_blank');">
click here to visit course page click here to visit course page
</button> </button>
</div> </div>

View File

@ -9,8 +9,8 @@
<img src="https://www.dropbox.com/s/6wzf3ebmj97v4zs/PySimpleGUI-GitHub-Udemy-Course.png?raw=1" width=200 alt="PySimpleGUI Udemy Course"> <img src="https://www.dropbox.com/s/6wzf3ebmj97v4zs/PySimpleGUI-GitHub-Udemy-Course.png?raw=1" width=200 alt="PySimpleGUI Udemy Course">
</td> </td>
<td> <td>
<h5>apply coupon for discount:<br>F988F082A3D18483B1C5</h6> <h5>apply coupon for discount:<br>62A4C02AB0A3DAB34388</h6>
<a href="https://www.udemy.com/course/pysimplegui/?couponCode=F988F082A3D18483B1C5">click here to visit course page</a> <a href="https://www.udemy.com/course/pysimplegui/?couponCode=62A4C02AB0A3DAB34388">click here to visit course page</a>
</td> </td>
</tr> </tr>
</table> </table>

View File

@ -52,9 +52,9 @@ HOW DO I INSERT IMAGES ???
<span style="font-weight: normal;"> <span style="font-weight: normal;">
apply coupon for discount: apply coupon for discount:
</span> </span>
9AF99B123C49D51EB547 62A4C02AB0A3DAB34388
</div> </div>
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=9AF99B123C49D51EB547','_blank');"> <button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=62A4C02AB0A3DAB34388','_blank');">
click here to visit course page click here to visit course page
</button> </button>
</div> </div>

View File

@ -25,9 +25,9 @@
<span style="font-weight: normal;"> <span style="font-weight: normal;">
apply coupon for discount: apply coupon for discount:
</span> </span>
9AF99B123C49D51EB547. 62A4C02AB0A3DAB34388.
</div> </div>
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=9AF99B123C49D51EB547','_blank');"> <button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=62A4C02AB0A3DAB34388','_blank');">
click here to visit course page click here to visit course page
</button> </button>
</div> </div>
@ -1207,12 +1207,18 @@ The following methods are here for backwards compatibility reference. You will
### metadata ### metadata
<!-- <+Listbox.metadata+> --> <!-- <+Listbox.metadata+> -->
### select_index
<!-- <+Listbox.select_index+> -->
### set_cursor ### set_cursor
<!-- <+Listbox.set_cursor+> --> <!-- <+Listbox.set_cursor+> -->
### set_focus ### set_focus
<!-- <+Listbox.set_focus+> --> <!-- <+Listbox.set_focus+> -->
### set_index_color
<!-- <+Listbox.set_index_color+> -->
### set_size ### set_size
<!-- <+Listbox.set_size+> --> <!-- <+Listbox.set_size+> -->

View File

@ -25,9 +25,9 @@
<span style="font-weight: normal;"> <span style="font-weight: normal;">
apply coupon for discount: apply coupon for discount:
</span> </span>
9AF99B123C49D51EB547. 62A4C02AB0A3DAB34388.
</div> </div>
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=9AF99B123C49D51EB547','_blank');"> <button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=62A4C02AB0A3DAB34388','_blank');">
click here to visit course page click here to visit course page
</button> </button>
</div> </div>
@ -5583,6 +5583,24 @@ Metadata is an Element property that you can use at any time to hold any value
|---|---|---| |---|---|---|
|(Any)| **return** | the current metadata value | |(Any)| **return** | the current metadata value |
### select_index
Selects an index while providing capability to setting the selected color for the index to specific text/background color
```
select_index(index,
highlight_text_color = None,
highlight_background_color = None)
```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| int | index | specifies which item to change. index starts at 0 and goes to length of values list minus one |
| str | highlight_text_color | color of the text when this item is selected. |
| str | highlight_background_color | color of the background when this item is selected |
### set_cursor ### set_cursor
Sets the cursor for the current Element. Sets the cursor for the current Element.
@ -5616,6 +5634,24 @@ Parameter Descriptions:
|--|--|--| |--|--|--|
| bool | force | if True will call focus_force otherwise calls focus_set | | bool | force | if True will call focus_force otherwise calls focus_set |
### set_index_color
Sets the color of a specific item without selecting it
```
set_index_color(index,
text_color = None,
background_color = None)
```
Parameter Descriptions:
|Type|Name|Meaning|
|--|--|--|
| int | index | specifies which item to change. index starts at 0 and goes to length of values list minus one |
| str | text_color | color of the text for this item |
| str | background_color | color of the background for this item |
### set_size ### set_size
Changes the size of an element to a specific size. Changes the size of an element to a specific size.

View File

@ -25,9 +25,9 @@
<span style="font-weight: normal;"> <span style="font-weight: normal;">
apply coupon for discount: apply coupon for discount:
</span> </span>
9AF99B123C49D51EB547 62A4C02AB0A3DAB34388
</div> </div>
<button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=9AF99B123C49D51EB547','_blank');"> <button style="margin: 0 auto; display: block; width: 200px; height: 70px; border-radius: 14px; border: none; padding: 10px; font-size: 18px; background-color: #357296; color: white; cursor: pointer;" onclick="window.open('https://www.udemy.com/course/pysimplegui/?couponCode=62A4C02AB0A3DAB34388','_blank');">
click here to visit course page click here to visit course page
</button> </button>
</div> </div>