Menu

Attributes problem etc

Anonymous
2022-01-04
2022-01-04
  • Anonymous

    Anonymous - 2022-01-04

    Firstly thank you so much for creating Page, it is certainly the simplest and quickest GUI creator I have found for python. I have a few queries though:

    1 Attributes: When I try to use the attributes editor on widgets I get the attributes window, but the attributes section is greyed out (image attached). I must be missing something but I don't know what!

    2 Events bindings: When I create a binding say to a button and I try it, I get an error eg:

    self.TButton1.bind('<button-1>',video_support.play) # GUI module</button-1>

    def play(): # support module

    I get the Error:

    TypeError: play() takes 0 positional arguments but 1 was given.

    This is easily resolved by : "def play(self)" but I am not sure why this isn't put in automatically?

    also it does automatically insert "sys.stdout.flush()" Is there a particular reason for this inclusion?

    3 Finally I am running Page 7.0 on Windows 10, after installing and running, I get an error "can't find python3" Again easily rectified by editing the Batch file and removing the "3" I believe the standard installation of Python 3 (On windows) always uses just "python" these days?

    Many Thanks

    James

     
  • Greg Walters

    Greg Walters - 2022-01-04

    Hi James.

    First, Thank you. Don has spent many hours over the years on PAGE and I can't begin to tell you how many hours on version 7.

    Now, to #1 - The image you attached shows the Attributes section in a collapsed state. You should be able to click on the gray Attributes bar and it should expand for you.

    For #2, there are two types of bindings available for buttons (and for some other widgets). One is the "normal" binding that you would use the Bindings editor for. The other is the command attribute. The command attribute sets a callback for that widget, in this case the button widget.

    So, if you want your callback to be called "on_btnPlay" (it's always best to make your functions self documenting) that's all you would put. No need to add the Parens. That makes Python think that you want to add parameters that can't be accounted for there.

    As for #3. Well, you are partially correct since the default is Python version 3.x. However, many systems still have (and use) Python 2.x for system programs.

    You can do as you suggested by changing that to "python" without the "3". Most systems, however, still uses the python3 to start Python. It just depends on your system.

    Now for a quick suggestion. PAGE wants to be run from your project folder, not from the desktop via the Icon. PAGE should already be in your path, so starting it should be as simple as typing page.bat.

    Navigate to your project folder either from the command prompt or using File Explorer. If you are using the File Explorer, when you get to your desired folder, hit <ctrl> L which will move the cursor to the address bar. Then type "cmd" and press enter. This opens the command prompt. Then start PAGE from the command prompt. Also, be sure to have a copy of any images or graphics in that folder or in an images folder within that folder. It will keep you from getting errors in the future.</ctrl>

    Greg

     

    Last edit: Greg Walters 2022-01-04
  • Greg Walters

    Greg Walters - 2022-01-04

    One more thing. Make sure that "python" actually starts python version 3.4 or greater. You can do that by starting a command prompt and typing "python -V" (make sure it's a capital V). That will tell you the version of Python you are running.

    PAGE no longer supports version 2.x but you might have that on your system as well.

    Greg

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.