Skip to content
New issue

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

[Question] Element int & update Pam Viewer #6130

Closed
7 tasks done
poco2018 opened this issue Dec 31, 2022 · 8 comments
Closed
7 tasks done

[Question] Element int & update Pam Viewer #6130

poco2018 opened this issue Dec 31, 2022 · 8 comments
Labels
Demo Programs Problem is in the demo programs (or any other non-core code) question Further information is requested

Comments

@poco2018
Copy link

Type of Issue (Enhancement, Error, Bug, Question)

Question
where is the program utility Element Int & Update Pam Viewer Program??

AND

How do you set the font size for the sg.main_sdk_help() program

Environment

Operating System

Windows version 10

PySimpleGUI Port (tkinter, Qt, Wx, Web)

tkinter


Versions

Python version (sg.sys.version)

3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)]

PySimpleGUI Version (sg.__version__)

4.60.4

GUI Version (tkinter (sg.tclversion_detailed), PySide2, WxPython, Remi)

8.6.12


Your Experience In Months or Years (optional)

5 Years Python programming experience
10 Years Programming experience overall
No Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)


Troubleshooting

These items may solve your problem. Please check those you've done by changing - [ ] to - [X]

  • Searched main docs for your problem www.PySimpleGUI.org
  • Looked for Demo Programs that are similar to your goal Demos.PySimpleGUI.org
  • If not tkinter - looked for Demo Programs for specific port
  • For non tkinter - Looked at readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
  • Run your program outside of your debugger (from a command line)
  • Searched through Issues (open and closed) to see if already reported Issues.PySimpleGUI.org
  • Tried using the PySimpleGUI.py file on GitHub. Your problem may have already been fixed but not released

Detailed Description

where is the program utitity Element Int & Update pam ViEwer??

AND

How do you set the font size for the sg.main_sdk-help() program

Code To Duplicate

# Paste your code here

Screenshot, Sketch, or Drawing

@jason990420
Copy link
Collaborator

where is the program utility Element Int & Update Pam Viewer Program??

What is the program utility Element Int & Update Pam Viewer Program ?

How do you set the font size for the sg.main_sdk_help() program

Basically, the font used for the elements and Multiline is hardcoded with ('Courier New', 10), and it cannot changed by user.

For my WIN10 with screen size, 1920x1080 (actually it will be 1536x864 for default DPI settings in tkinter), the window of sg.main_sdk_help() is beyond of my screen.

@PySimpleGUI
Copy link
Owner

I should minimally make the SDK reference a demo program.

The parameter viewer from the Udemy course hasn't been released as a utility. I'll look into releasing that as a demo program as well.

@poco2018
Copy link
Author

poco2018 commented Jan 1, 2023 via email

@PySimpleGUI
Copy link
Owner

Now that I checked, these were actually released as Demo Programs in January 2022, shortly after the Udemy course was released. They're in the Demo Programs folder.

https://github.com/PySimpleGUI/PySimpleGUI/blob/master/DemoPrograms/Demo_SDK_Help_Func_Parms.py
https://github.com/PySimpleGUI/PySimpleGUI/blob/master/DemoPrograms/Demo_SDK_Help_Init_Update_Parms.py

@poco2018
Copy link
Author

poco2018 commented Jan 1, 2023 via email

@PySimpleGUI
Copy link
Owner

Not sure what's going off the screen... but regardless of which element it is, the size parameter will control how large something is and will thus enable you to change how big the element is.

It'll be a while before I can do anything with making the help window a demo. Using an IDE with the docstrings (e.g. PyCharm, Wing) will remove the need for online docs or the help window. The online docs are your best choice if you're not using an IDE with the docstrings.

@poco2018
Copy link
Author

poco2018 commented Jan 1, 2023 via email

@jason990420 jason990420 added question Further information is requested Demo Programs Problem is in the demo programs (or any other non-core code) labels Jan 2, 2023
@PySimpleGUI
Copy link
Owner

PyCharm is free as well. I'm not sure exactly how to integrate docstrings in VS code. A plugin may be required, but haven't looked into the details.

The PySimpleGUI code doesn't do any scraping. The web browser calls are to open the web browser if you click on the link at the bottom of the window. The window uses the Python help system and in some places the inspect module. You can access the help system right from the console/command line.

You can get help on Elements and individual methods like the update method. Same with functions. Just call help() with the item you want to see the docstrings for.

C:\Python\PycharmProjects\PSG>python
Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import PySimpleGUI as sg
>>> help(sg.Button.update)
Help on function update in module PySimpleGUI:

update(self, text=None, button_color=(None, None), disabled=None, image_source=None, image_data=None, image_filename=None, visible=None, image_subsample=None, image_zoom=None, disabled_button_color=(None, None), image_size=None)
    Changes some of the settings for the Button Element. Must call `Window.Read` or `Window.Finalize` prior

    Changes will not be visible in your window until you call window.read or window.refresh.

    If you change visibility, your element may MOVE. If you want it to remain stationary, use the "layout helper"
    function "pin" to ensure your element is "pinned" to that location in your layout so that it returns there
    when made visible.

    :param text:                  sets button text
    :type text:                   (str)
    :param button_color:          Color of button. default is from theme or the window. Easy to remember which is which if you say "ON" between colors. "red" on "green". Normally a tuple, but can be a simplified-button-color-string "foreground on background". Can be a single color if want to set only the background.
    :type button_color:           (str, str) | str
    :param disabled:              True/False to enable/disable at the GUI level. Use BUTTON_DISABLED_MEANS_IGNORE to ignore clicks (won't change colors)
    :type disabled:               (bool | str)
    :param image_source:          Image to place on button. Use INSTEAD of the image_filename and image_data. Unifies these into 1 easier to use parm
    :type image_source:           (str | bytes)
    :param image_data:            Raw or Base64 representation of the image to put on button. Choose either filename or data
    :type image_data:             bytes | str
    :param image_filename:        image filename if there is a button image. GIFs and PNGs only.
    :type image_filename:         (str)
-- More  --

One advantage the website https://www.PySimpleGUI.org has is the search box which will not only find the calls but other related information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Demo Programs Problem is in the demo programs (or any other non-core code) question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants