This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#226 2013-04-30 18:23:04

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: M30W New Official Topic

A decorator is a convenient way to generate function wrappers. It is a function that when called with the original functions returns a wrapped version of it. In my case, I simply add the functions I get to the dictionary.

After looking at your code, I would've fully parsed the args and then use a dictionary with the commands and the corresponding functions. You can code the whole logic about what to do if you have different number args into the methods you call.

@davidkt, svn, or subversion, is the version control software we use to share code.look in Wikipedia or just google it for guides. What OS do you use?

Offline

 

#227 2013-04-30 18:34:16

davidkt
Scratcher
Registered: 2011-11-09
Posts: 100+

Re: M30W New Official Topic

roijac wrote:

@davidkt, svn, or subversion, is the version control software we use to share code.look in Wikipedia or just google it for guides. What OS do you use?

I use Windows 8 (Opera 12.15). I looked at Wikipedia and I think you have to put it on a website- what website is it that we're using?


I'm Upsilon920 for everything else.
http://www.blocks.scratchr.org/API.php?action=text&string=I_am_currently_&bgr=123&bgg=132http://blocks.scratchr.org/API.php?user=davidkt&action=onlineStatus&type=squarehttp://blocks.scratchr.org/API.php?user=davidkt&action=onlineStatus&type=text

Offline

 

#228 2013-05-01 05:00:12

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: M30W New Official Topic

Sourceforge - that's why you need a sf account  wink

If you're using windows I suggest you use tortoiseSVN.

Offline

 

#229 2013-05-01 17:26:58

davidkt
Scratcher
Registered: 2011-11-09
Posts: 100+

Re: M30W New Official Topic

roijac wrote:

Sourceforge - that's why you need a sf account  wink

If you're using windows I suggest you use tortoiseSVN.

1. Link?
2. What's the point of this svn anyway?


I'm Upsilon920 for everything else.
http://www.blocks.scratchr.org/API.php?action=text&string=I_am_currently_&bgr=123&bgg=132http://blocks.scratchr.org/API.php?user=davidkt&action=onlineStatus&type=squarehttp://blocks.scratchr.org/API.php?user=davidkt&action=onlineStatus&type=text

Offline

 

#230 2013-05-01 19:14:54

davidkt
Scratcher
Registered: 2011-11-09
Posts: 100+

Re: M30W New Official Topic

I don't know what went wrong. I tried to add a menu (called Tools) with 1 item and it's showing an error message saying that the menu item's tuple doesn't have 3 items (the name, id and callback function, respectively) which it does. I've tried to debug it, but it still shows the ValueError. Help?


I'm Upsilon920 for everything else.
http://www.blocks.scratchr.org/API.php?action=text&string=I_am_currently_&bgr=123&bgg=132http://blocks.scratchr.org/API.php?user=davidkt&action=onlineStatus&type=squarehttp://blocks.scratchr.org/API.php?user=davidkt&action=onlineStatus&type=text

Offline

 

#231 2013-05-02 07:55:07

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: M30W New Official Topic

davidkt wrote:

roijac wrote:

Sourceforge - that's why you need a sf account  wink

If you're using windows I suggest you use tortoiseSVN.

1. Link?

link

2. What's the point of this svn anyway?

http://betterexplained.com/articles/a-v … n-control/
It's like a shared dropbox folder for code  smile


@menus, check for apostrophes missing etc, I can't really help further. If you want help coding you should probably post the code you used  smile

Offline

 

#232 2013-05-02 15:39:49

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: M30W New Official Topic

Okay, thanks for the info guys.

Also, I made a couple buttons. Lighter ones would be used for mouse-hover and when the project is running/stopped.

http://i1147.photobucket.com/albums/o549/Magnie/play_stop_buttons_zps68dea6c7.png

Offline

 

#233 2013-05-02 16:01:04

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: M30W New Official Topic

I implemented the Engine!  big_smile

Magnie wrote:

Okay, thanks for the info guys.

Also, I made a couple buttons. Lighter ones would be used for mouse-hover and when the project is running/stopped.

http://i1147.photobucket.com/albums/o54 … dea6c7.png

Nice ones - could you check them out to the icons folder, but with transparent background?

I thought maybe we could put the sprites scrollbar between the stage and the spritesPanel and add the buttons there - for now I made two menu items.

Offline

 

#234 2013-05-02 16:50:03

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: M30W New Official Topic

I feel so special, my first commit to M30W!  tongue

Anyways, do you want me to commit smaller ones (50x50 rather than 100x100, or any other size you want)?

Are there any other images you want (may as well use this opportunity to get better at my graphic design skills)?

Offline

 

#235 2013-05-02 17:00:53

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: M30W New Official Topic

Magnie wrote:

I feel so special, my first commit to M30W!  tongue

Anyways, do you want me to commit smaller ones (50x50 rather than 100x100, or any other size you want)?

Are there any other images you want (may as well use this opportunity to get better at my graphic design skills)?

mmm, probably 16x16 would be good, you know, like all the other icons  wink

Offline

 

#236 2013-05-02 17:15:21

davidkt
Scratcher
Registered: 2011-11-09
Posts: 100+

Re: M30W New Official Topic

davidkt wrote:

I don't know what went wrong. I tried to add a menu (called Tools) with 1 item and it's showing an error message saying that the menu item's tuple doesn't have 3 items (the name, id and callback function, respectively) which it does. I've tried to debug it, but it still shows the ValueError. Help?

Umm...
p.s. I'll take care of the executer for you (just what's this error about?)

roijac wrote:

If you want help coding you should probably post the code you used  wink

menu.py, line 190-191:

Code:

Tools = (("&Run Project", wx.ID_ANY, OnRun)
        )

line 196:

Code:

menus = (('&File', File), ('&Edit', Edit), ('&Tools', Tools), ('&Help', Help))

Error Message:

Code:

Traceback (most recent call last):
 File "C:\Python27\Lib\site-packages\M30W\__init__.py", line 30, in <module>
main()
 File "C:\Python27\Lib\site-packages\M30W\__init__.py", line 26, in main
show_app()
 File "C:\Python27\lib\site-packages\M30W\GUI\main.py", line 94, in show_app
app.CreateGUI()
 File "C:\Python27\lib\site-packages\M30W\GUI\main.py", line 67, in CreateGUI
self.mainFrame = MainFrame(None)
 File "C:\Python27\lib\site-packages\M30W\GUI\mainFrame.py", line 40, in __init__
menubar = MenuBar(self, menus)
 File "C:\Python27\lib\site-packages\M30W\GUI\menu.py", line 55, in __init__
self.Append(Menu(self.parent, items), title)
 File "C:\Python27\lib\site-packages\M30W\GUI\menu.py", line 38, in __init__
for item, itemid, callback in items:
ValueError: too many values to unpack

I know... confusing, I don't know what caused the problem, it looks like it has three values...

Last edited by davidkt (2013-05-02 17:27:00)


I'm Upsilon920 for everything else.
http://www.blocks.scratchr.org/API.php?action=text&amp;string=I_am_currently_&amp;bgr=123&amp;bgg=132http://blocks.scratchr.org/API.php?user=davidkt&amp;action=onlineStatus&amp;type=squarehttp://blocks.scratchr.org/API.php?user=davidkt&amp;action=onlineStatus&amp;type=text

Offline

 

#237 2013-05-02 17:35:17

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: M30W New Official Topic

Does the object 'Tools' even exist?

@roijac: Well, the only real icon in there is 128x128.  wink

Offline

 

#238 2013-05-02 17:53:42

davidkt
Scratcher
Registered: 2011-11-09
Posts: 100+

Re: M30W New Official Topic

"Tools" isn't an object, it's an array.


I'm Upsilon920 for everything else.
http://www.blocks.scratchr.org/API.php?action=text&amp;string=I_am_currently_&amp;bgr=123&amp;bgg=132http://blocks.scratchr.org/API.php?user=davidkt&amp;action=onlineStatus&amp;type=squarehttp://blocks.scratchr.org/API.php?user=davidkt&amp;action=onlineStatus&amp;type=text

Offline

 

#239 2013-05-02 17:58:44

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: M30W New Official Topic

Wow, I feel like an idiot.

Offline

 

#240 2013-05-03 11:01:15

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: M30W New Official Topic

davidkt wrote:

davidkt wrote:

I don't know what went wrong. I tried to add a menu (called Tools) with 1 item and it's showing an error message saying that the menu item's tuple doesn't have 3 items (the name, id and callback function, respectively) which it does. I've tried to debug it, but it still shows the ValueError. Help?

Umm...
p.s. I'll take care of the executer for you (just what's this error about?)

roijac wrote:

If you want help coding you should probably post the code you used  wink

menu.py, line 190-191:

Code:

Tools = (("&Run Project", wx.ID_ANY, OnRun)
        )

line 196:

Code:

menus = (('&File', File), ('&Edit', Edit), ('&Tools', Tools), ('&Help', Help))

Error Message:

Code:

Traceback (most recent call last):
 File "C:\Python27\Lib\site-packages\M30W\__init__.py", line 30, in <module>
main()
 File "C:\Python27\Lib\site-packages\M30W\__init__.py", line 26, in main
show_app()
 File "C:\Python27\lib\site-packages\M30W\GUI\main.py", line 94, in show_app
app.CreateGUI()
 File "C:\Python27\lib\site-packages\M30W\GUI\main.py", line 67, in CreateGUI
self.mainFrame = MainFrame(None)
 File "C:\Python27\lib\site-packages\M30W\GUI\mainFrame.py", line 40, in __init__
menubar = MenuBar(self, menus)
 File "C:\Python27\lib\site-packages\M30W\GUI\menu.py", line 55, in __init__
self.Append(Menu(self.parent, items), title)
 File "C:\Python27\lib\site-packages\M30W\GUI\menu.py", line 38, in __init__
for item, itemid, callback in items:
ValueError: too many values to unpack

I know... confusing, I don't know what caused the problem, it looks like it has three values...

Common beginner mistake  tongue
Add a comma!

Anyway I put it in the Edit menu - I think it's better to have some items in the menus instead of four menus with 3-4 items each  wink

Last edited by roijac (2013-05-03 11:03:09)

Offline

 

#241 2013-05-03 16:38:08

davidkt
Scratcher
Registered: 2011-11-09
Posts: 100+

Re: M30W New Official Topic

roijac wrote:

davidkt wrote:

davidkt wrote:

I don't know what went wrong. I tried to add a menu (called Tools) with 1 item and it's showing an error message saying that the menu item's tuple doesn't have 3 items (the name, id and callback function, respectively) which it does. I've tried to debug it, but it still shows the ValueError. Help?

Umm...
p.s. I'll take care of the executer for you (just what's this error about?)

roijac wrote:

If you want help coding you should probably post the code you used  wink

menu.py, line 190-191:

Code:

Tools = (("&Run Project", wx.ID_ANY, OnRun)
        )

line 196:

Code:

menus = (('&File', File), ('&Edit', Edit), ('&Tools', Tools), ('&Help', Help))

Error Message:

Code:

Traceback (most recent call last):
 File "C:\Python27\Lib\site-packages\M30W\__init__.py", line 30, in <module>
main()
 File "C:\Python27\Lib\site-packages\M30W\__init__.py", line 26, in main
show_app()
 File "C:\Python27\lib\site-packages\M30W\GUI\main.py", line 94, in show_app
app.CreateGUI()
 File "C:\Python27\lib\site-packages\M30W\GUI\main.py", line 67, in CreateGUI
self.mainFrame = MainFrame(None)
 File "C:\Python27\lib\site-packages\M30W\GUI\mainFrame.py", line 40, in __init__
menubar = MenuBar(self, menus)
 File "C:\Python27\lib\site-packages\M30W\GUI\menu.py", line 55, in __init__
self.Append(Menu(self.parent, items), title)
 File "C:\Python27\lib\site-packages\M30W\GUI\menu.py", line 38, in __init__
for item, itemid, callback in items:
ValueError: too many values to unpack

I know... confusing, I don't know what caused the problem, it looks like it has three values...

Common beginner mistake  tongue
Add a comma!

Anyway I put it in the Edit menu - I think it's better to have some items in the menus instead of four menus with 3-4 items each  wink

Oops... I'm not a beginner, I've just not used tuples lately- just lists, so I forgot the one-item rule.
Anyway, I was going to put some more options in the Tools menu, like "Debug", "Run with Error Console", and "Show Interactive Shell". Look at IDLE (which I barely ever use), the last 5 menus have 1-4 options! Anyway, how does "Run Project" fit under "Edit"?


I'm Upsilon920 for everything else.
http://www.blocks.scratchr.org/API.php?action=text&amp;string=I_am_currently_&amp;bgr=123&amp;bgg=132http://blocks.scratchr.org/API.php?user=davidkt&amp;action=onlineStatus&amp;type=squarehttp://blocks.scratchr.org/API.php?user=davidkt&amp;action=onlineStatus&amp;type=text

Offline

 

#242 2013-05-03 16:41:59

davidkt
Scratcher
Registered: 2011-11-09
Posts: 100+

Re: M30W New Official Topic

BTW, svn is working now!


I'm Upsilon920 for everything else.
http://www.blocks.scratchr.org/API.php?action=text&amp;string=I_am_currently_&amp;bgr=123&amp;bgg=132http://blocks.scratchr.org/API.php?user=davidkt&amp;action=onlineStatus&amp;type=squarehttp://blocks.scratchr.org/API.php?user=davidkt&amp;action=onlineStatus&amp;type=text

Offline

 

#243 2013-05-03 17:23:10

davidkt
Scratcher
Registered: 2011-11-09
Posts: 100+

Re: M30W New Official Topic

Should I start working on the executer? If you're already working on it, maybe I could do a different part...


I'm Upsilon920 for everything else.
http://www.blocks.scratchr.org/API.php?action=text&amp;string=I_am_currently_&amp;bgr=123&amp;bgg=132http://blocks.scratchr.org/API.php?user=davidkt&amp;action=onlineStatus&amp;type=squarehttp://blocks.scratchr.org/API.php?user=davidkt&amp;action=onlineStatus&amp;type=text

Offline

 

#244 2013-05-04 17:52:14

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: M30W New Official Topic

I wouldn't consider IDLE as the perfect designed app  smile
I thought 'Run Project' fits under 'Edit' because when you edit a project, you run it. As we get to more features, we can look into it but now we should focus more on getting all the blocks to work - we still have 7 categories to go, variable watchers, speech bubbles, costumes sizing etc.  hmm
What you can do right now is fixing the costume center bug on windows where the controls don't get focus, add new blocks and look into mouseclicking/keyboard events.
The execution engine is completed, except for one little bug affecting the switching between scripts.  tongue

Glad svn is working  smile

Offline

 

#245 2013-05-04 20:21:00

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: M30W New Official Topic

I recently downloaded a snapshot to (attempt to) hack away at it. I know some Python basics; hopefully I can do something. I'm checking the bug tracker. Interesting project indeed. c:


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#246 2013-05-04 21:27:06

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: M30W New Official Topic

roijac wrote:

I wouldn't consider IDLE as the perfect designed app  smile
I thought 'Run Project' fits under 'Edit' because when you edit a project, you run it. As we get to more features, we can look into it but now we should focus more on getting all the blocks to work - we still have 7 categories to go, variable watchers, speech bubbles, costumes sizing etc.  hmm
What you can do right now is fixing the costume center bug on windows where the controls don't get focus, add new blocks and look into mouseclicking/keyboard events.
The execution engine is completed, except for one little bug affecting the switching between scripts.  tongue

Glad svn is working  smile

You should commit soon. :p

Offline

 

#247 2013-05-05 04:51:45

darkness3560
Scratcher
Registered: 2010-07-28
Posts: 30

Re: M30W New Official Topic

Thanks, I got M30W working.  I needed to run "sudo puthon setup.py install.


http://1024128.webs.com/1.pnghttp://1024128.webs.com/2.pnghttp://1024128.webs.com/3.pnghttp://1024128.webs.com/4.png
Pi is Pi, and Pi is 3.1415926535897932384626433832795028841971693993751058209749.

Offline

 

#248 2013-05-05 05:35:44

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: M30W New Official Topic

darkness3560 wrote:

Thanks, I got M30W working.  I needed to run "sudo puthon setup.py install.

tongue

technoguyx wrote:

I recently downloaded a snapshot to (attempt to) hack away at it. I know some Python basics; hopefully I can do something. I'm checking the bug tracker. Interesting project indeed. c:

You can implement blocks  smile

Magnie wrote:

You should commit soon. :p

#rev104?
You can run some scripts.

Offline

 

#249 2013-05-05 11:31:36

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: M30W New Official Topic

roijac wrote:

technoguyx wrote:

I recently downloaded a snapshot to (attempt to) hack away at it. I know some Python basics; hopefully I can do something. I'm checking the bug tracker. Interesting project indeed. c:

You can implement blocks  smile

I was already looking into implementing a "Project Summary" window, actually. So far, it's just a dialog with "Apply" and "Cancel" buttons.  tongue


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#250 2013-05-05 17:54:42

davidkt
Scratcher
Registered: 2011-11-09
Posts: 100+

Re: M30W New Official Topic

roijac wrote:

The execution engine is completed, except for one little bug affecting the switching between scripts.  tongue

Where is it then?

Also I can make executable binaries for windows. What "costume center bug" is there? I need something to do during May 6-8.

Edit: I don't use idle either. I use spe.

Last edited by davidkt (2013-05-05 17:55:43)


I'm Upsilon920 for everything else.
http://www.blocks.scratchr.org/API.php?action=text&amp;string=I_am_currently_&amp;bgr=123&amp;bgg=132http://blocks.scratchr.org/API.php?user=davidkt&amp;action=onlineStatus&amp;type=squarehttp://blocks.scratchr.org/API.php?user=davidkt&amp;action=onlineStatus&amp;type=text

Offline

 

Board footer