M30W Programming Forum

M30W is a text-based version of Scratch

You are not logged in.

Announcement

This is the development forum for M30W (also known as Emerald, do not confuse with Emerald Programming Language).
Our Non-development forums are available here

M30W(Emerald) 0.3 is out! (Download) Requires Python 2.6 or higher.
Opal 0.3(A better command line M30W) is out! (Download) Requires Python 2.6 or higher.
M30W 0.3.6 GUI barebones (Download) Requires Python 2.6 or higher and wxPython
Diamond-2 RED2 GUI Barebones (Fancy M30W editor) s out! (Download) Requires .NET Framework 3.5 or higher, does not require Python
M30W++ GUI barebones (Java M30W) Alpha 1 is out! (Download) Requires Java.


Gershmer.net, our hosting, will close in February 2011. We have not fully decided what to do with our hosting after that, but we will tell you when we decide.

Adverts

Adverts

#1 2009-10-20 02:17:01

Greatdane
Member
From: Somewhere on this planet
Registered: 2009-10-20
Posts: 5
Website

Better GUI

Maybe we can make buttons on the GUI? Or something else...


Greatdane from scratch (DUH! :P)

Offline

 

2009-10-20 02:17:01

AdBot
Advertisements

#2 2009-10-20 03:52:26

Magnie
> I am Ninja! <
From: Polaris, the planet
Registered: 2009-10-08
Posts: 321
Website

Re: Better GUI

If you do that, then you'll be on the team! :D


- I speak IF Common -
  ~ Magnie Mozios ~

Offline

 

#3 2009-10-20 18:15:02

Gershmer
Admin
From: Newton Centre, Massachusetts
Registered: 2009-10-08
Posts: 515
Website

Re: Better GUI

YAY! Finally a member that has a join date other than 10-08-09!

Anyway:

Download Python 2.6 from http://www.python.org.
Download the current version of Emerald (0.3) from http://gershmer.net/emeraldteam/emerald-0.3.zip
Learn the Basics of Python from http://docs.python.org/tutorial/
Learn the Basics of Tkinter (what we're using for a GUI) from http://www.pythonware.com/library/tkinter/introduction/

HAVE FUN! AND ENJOY EMERALD!

I'm looking forward to Emerald 0.4 (or at least a non-qualifying for joining the Team 0.3.1, anyway)


http://card.ly/images/vcard-green-small.png

Offline

 

#4 2009-10-20 19:01:56

Magnie
> I am Ninja! <
From: Polaris, the planet
Registered: 2009-10-08
Posts: 321
Website

Re: Better GUI

I've heard that Floppy is making it so you can type in your program like typing it in notepad but in Emerald instead. :o Can't wait! That will be 0.4 so Greatdane will need to wait for 0.4 then he can add some items for 0.5


- I speak IF Common -
  ~ Magnie Mozios ~

Offline

 

#5 2009-10-20 20:23:44

Gershmer
Admin
From: Newton Centre, Massachusetts
Registered: 2009-10-08
Posts: 515
Website

Re: Better GUI

Magnie wrote:

I've heard that Floppy is making it so you can type in your program like typing it in notepad but in Emerald instead. :o Can't wait! That will be 0.4 so Greatdane will need to wait for 0.4 then he can add some items for 0.5

But what if Greatdane is faster?


http://card.ly/images/vcard-green-small.png

Offline

 

#6 2009-10-20 21:21:39

Magnie
> I am Ninja! <
From: Polaris, the planet
Registered: 2009-10-08
Posts: 321
Website

Re: Better GUI

idk, one feature will need to come before another, besides Greatdane said he had no experience with Python or something..


- I speak IF Common -
  ~ Magnie Mozios ~

Offline

 

#7 2009-10-31 01:32:13

Greatdane
Member
From: Somewhere on this planet
Registered: 2009-10-20
Posts: 5
Website

Re: Better GUI

You must've heard me wrong! I have a LOT of experience with python, none with C-related, and some with Java.


Greatdane from scratch (DUH! :P)

Offline

 

#8 2009-10-31 14:13:56

Magnie
> I am Ninja! <
From: Polaris, the planet
Registered: 2009-10-08
Posts: 321
Website

Re: Better GUI

*Gasp* Really? Well then get to work!


- I speak IF Common -
  ~ Magnie Mozios ~

Offline

 

#9 2009-10-31 15:37:18

Greatdane
Member
From: Somewhere on this planet
Registered: 2009-10-20
Posts: 5
Website

Re: Better GUI

Let me teach you about PythonCard. (My interface suggestion)

PythonCard resourceEditor is a beautiful editor to create your own applications. You can drag and drop buttons, resize them, all kinds of stuff. I made a calculator program. Extract it and run 'calculator.py', not 'calculator.rscr.py'.

The minimal amount of code(for the python file) is this:

Code:

from PythonCard import model

class MainWindow(model.Background):
    pass

app = model.Application(MainWindow)
app.MainLoop()

It's that easy. For my calculator program:

Code:

from PythonCard import model

number = "false"
number1 = "false"
number2 = "false"
operator = "false"
decimalOn = 0
decimalDigits = "false"
decimalDigit = "false"
class MainWindow(model.Background):
    
    def on_number1_mouseClick(self, event):
        global number
        global decimalOn
        global decimalDigits
        global decimalDigit
        if decimalOn == 0:
            if number == "false":
                number = 1
            else:
                number = (number * 10) + 1
            number = int(number)
        else:
            if decimalDigits == "false":
                decimalDigits = 1
                number = float(number) + (1.0 / (10 ** decimalDigits))
                decimalDigits += 1
                decimalDigit = 1
            else:
                number = float(number) + (1.0 / (10 ** decimalDigits))
                decimalDigits +=1
                decimalDigit = 1
        self.components.showField.text = str(number)
    def on_number2_mouseClick(self, event):
        global number
        global decimalOn
        global decimalDigits
        global decimalDigit
        if decimalOn == 0:
            if number == "false":
                number = 2
            else:
                number = (number * 10) + 2
            number = int(number)
        else:
            if decimalDigits == "false":
                decimalDigits = 1
                number = float(number) + (2.0 / (10 ** decimalDigits))
                decimalDigits += 1
                decimalDigit = 2
            else:
                number = float(number) + (2.0 / (10 ** decimalDigits))
                decimalDigits +=1
                decimalDigit = 2
        self.components.showField.text = str(number)
    def on_number3_mouseClick(self, event):
        global number
        global decimalOn
        global decimalDigits
        global decimalDigit
        if decimalOn == 0:
            if number == "false":
                number = 3
            else:
                number = (number * 10) + 3
            number = int(number)
        else:
            if decimalDigits == "false":
                decimalDigits = 1
                number = float(number) + (3.0 / (10 ** decimalDigits))
                decimalDigits += 1
                decimalDigit = 3
            else:
                number = float(number) + (3.0 / (10 ** decimalDigits))
                decimalDigits +=1
                decimalDigit = 3
        self.components.showField.text = str(number)
    def on_number4_mouseClick(self, event):
        global number
        global decimalOn
        global decimalDigits
        global decimalDigit
        if decimalOn == 0:
            if number == "false":
                number = 4
            else:
                number = (number * 10) + 4
            number = int(number)
        else:
            if decimalDigits == "false":
                decimalDigits = 1
                number = float(number) + (4.0 / (10 ** decimalDigits))
                decimalDigits += 1
                decimalDigit = 4
            else:
                number = float(number) + (4.0 / (10 ** decimalDigits))
                decimalDigits +=1
                decimalDigit = 4
        self.components.showField.text = str(number)
    def on_number5_mouseClick(self, event):
        global number
        global decimalOn
        global decimalDigits
        global decimalDigit
        if decimalOn == 0:
            if number == "false":
                number = 5
            else:
                number = (number * 10) + 5
            number = int(number)
        else:
            if decimalDigits == "false":
                decimalDigits = 1
                number = float(number) + (5.0 / (10 ** decimalDigits))
                decimalDigits += 1
                decimalDigit = 5
            else:
                number = float(number) + (5.0 / (10 ** decimalDigits))
                decimalDigits +=1
                decimalDigit = 5
        self.components.showField.text = str(number)
    def on_number6_mouseClick(self, event):
        global number
        global decimalOn
        global decimalDigits
        global decimalDigit
        if decimalOn == 0:
            if number == "false":
                number = 6
            else:
                number = (number * 10) + 6
            number = int(number)
        else:
            if decimalDigits == "false":
                decimalDigits = 1
                number = float(number) + (6.0 / (10 ** decimalDigits))
                decimalDigits += 1
                decimalDigit = 6
            else:
                number = float(number) + (6.0 / (10 ** decimalDigits))
                decimalDigits +=1
                decimalDigit = 6
        self.components.showField.text = str(number)
    def on_number7_mouseClick(self, event):
        global number
        global decimalOn
        global decimalDigits
        global decimalDigit
        if decimalOn == 0:
            if number == "false":
                number = 7
            else:
                number = (number * 10) + 7
            number = int(number)
        else:
            if decimalDigits == "false":
                decimalDigits = 1
                number = float(number) + (7.0 / (10 ** decimalDigits))
                decimalDigits += 1
                decimalDigit = 7
            else:
                number = float(number) + (7.0 / (10 ** decimalDigits))
                decimalDigits +=1
                decimalDigit = 7
        self.components.showField.text = str(number)
    def on_number8_mouseClick(self, event):
        global number
        global decimalOn
        global decimalDigits
        global decimalDigit
        if decimalOn == 0:
            if number == "false":
                number = 8
            else:
                number = (number * 10) + 8
            number = int(number)
        else:
            if decimalDigits == "false":
                decimalDigits = 1
                number = float(number) + (8.0 / (10 ** decimalDigits))
                decimalDigits += 1
                decimalDigit = 8
            else:
                number = float(number) + (8.0 / (10 ** decimalDigits))
                decimalDigits +=1
                decimalDigit = 8
        self.components.showField.text = str(number)
    def on_number9_mouseClick(self, event):
        global number
        global decimalOn
        global decimalDigits
        global decimalDigit
        if decimalOn == 0:
            if number == "false":
                number = 9
            else:
                number = (number * 10) + 9
            number = int(number)
        else:
            if decimalDigits == "false":
                decimalDigits = 1
                number = float(number) + (9.0 / (10 ** decimalDigits))
                decimalDigits += 1
                decimalDigit = 9
            else:
                number = float(number) + (9.0 / (10 ** decimalDigits))
                decimalDigits +=1
                decimalDigit = 9
        self.components.showField.text = str(number)
    def on_number0_mouseClick(self, event):
        global number
        global decimalOn
        global decimalDigits
        global decimalDigit
        if decimalOn == 0:
            if number == "false":
                number = 0
            else:
                number = (number * 10)
            number = int(number)
        else:
            if decimalDigits == "false":
                decimalDigits = 1
                number = float(number) + (0 / (10 ** decimalDigits))
                decimalDigits += 1
                decimalDigit = 0
            else:
                number = float(number) + (0 / (10 ** decimalDigits))
                decimalDigits +=1
                decimalDigit = 0
        self.components.showField.text = str(number)
    def on_numberP_mouseClick(self, event):
        global number
        global decimalOn
        global decimalDigits
        if number == "false":
            number = 0.0
        else:
            if decimalOn != 1:
                decimalOn = 1
            number = float(number)
        decimalDigits = 1
        self.components.showField.text = str(number)
    def on_Clearb_mouseClick(self, event):
        global number
        global decimalOn
        global decimalDigits
        global decimalDigit
        number = 0
        decimalOn = 0
        decimalDigits = 0
        decimalDigit = 0
        self.components.showField.text = str(number)
    def on_Backspaceb_mouseClick(self, event):
        global number
        if decimalOn != 1:
            if number != "false" and number != 0:
                number = number / 10
            number = int(number)
        else:
                number = number - (int(decimalDigit) / (10 ** decimalDigits))
        self.components.showField.text = str(number)
    def on_operatorAdd_mouseClick(self, event):
        global number
        global number1
        global operator
        global decimalOn
        decimalOn = 0
        number1 = number
        operator = "add"
        number = 0
        self.components.showField.text = str(number)
    def on_operatorSubtract_mouseClick(self, event):
        global number
        global number1
        global operator
        global decimalOn
        decimalOn = 0
        number1 = number
        operator = "subtract"
        number = 0
        self.components.showField.text = str(number)
    def on_operatorMultiply_mouseClick(self, event):
        global number
        global number1
        global operator
        global decimalOn
        decimalOn = 0
        number1 = number
        operator = "multiply"
        number = 0
        self.components.showField.text = str(number)
    def on_operatorDivide_mouseClick(self, event):
        global number
        global number1
        global operator
        global decimalOn
        decimalOn = 0
        number1 = number
        operator = "divide"
        number = 0
        self.components.showField.text = str(number)
    def on_Enterb_mouseClick(self, event):
        global number
        global number1
        global number2
        global operator
        global decimalOn
        decimalOn = 0
        if operator == "add":
            number2 = number1 + number
        if operator == "subtract":
            number2 = number1 - number
        if operator == "multiply":
            number2 = number1 * number
        if operator == "divide":
            number2 = float(number1) / float(number)
        number = number2
        self.components.showField.text = str(number)
        number1 = number
        
app = model.Application(MainWindow)
app.MainLoop()

But that's  a calculator program.
An event is triggered like this:

Code:

def on_buttonname_mouseClick(self, event):

Replace buttonname with the name of your button in PythonCard.
Hope that helps!


Greatdane from scratch (DUH! :P)

Offline

 

#10 2009-10-31 22:32:13

Magnie
> I am Ninja! <
From: Polaris, the planet
Registered: 2009-10-08
Posts: 321
Website

Re: Better GUI

If you implement this in the current version of Emerald, and if it's any better, then we might go with it.


- I speak IF Common -
  ~ Magnie Mozios ~

Offline

 

#11 2009-11-07 02:30:55

Greatdane
Member
From: Somewhere on this planet
Registered: 2009-10-20
Posts: 5
Website

Re: Better GUI

I did in the other post on scratch.


Greatdane from scratch (DUH! :P)

Offline

 

#12 2009-11-15 09:31:26

markyparky56
Hi...
From: Scotland
Registered: 2009-10-08
Posts: 910
Website

Re: Better GUI

wow... if greatdanes that good with python, whys he not classed as a team member yet?


I am A M30Wr.
I always get the last word.

Offline

 

#13 2009-11-15 13:22:06

Gershmer
Admin
From: Newton Centre, Massachusetts
Registered: 2009-10-08
Posts: 515
Website

Re: Better GUI

markyparky56 wrote:

wow... if greatdanes that good with python, whys he not classed as a team member yet?

You have to do something that
a) costs money
b) create an UPDATE to the current version of Emerald that has a big enough changelog


http://card.ly/images/vcard-green-small.png

Offline

 

#14 2009-11-15 15:14:30

markyparky56
Hi...
From: Scotland
Registered: 2009-10-08
Posts: 910
Website

Re: Better GUI

it costs money? and how hard is it to add his name to the list?


I am A M30Wr.
I always get the last word.

Offline

 

#15 2009-11-15 18:11:08

Gershmer
Admin
From: Newton Centre, Massachusetts
Registered: 2009-10-08
Posts: 515
Website

Re: Better GUI

markyparky56 wrote:

it costs money? and how hard is it to add his name to the list?

What? Learn2read, marky.


I was stating the criteria of getting accepted to the Team.

Criteria required: (you have to do one or the other)
-Do something for us that costs money
-Updates current version of Emerald, with a worthy changelog


It just so happens that I got in the 1st way. Hehe.


But, not the point.
So far, Greatdane only has demonstrated a GUI made with PythonCard/wxpython, and a notepad + line counter in that GUI example.



And about adding his name to the list, only Magnie can do that.
Magnie = founder
Magnie = person who has the power to give mod privs


http://card.ly/images/vcard-green-small.png

Offline

 

#16 2009-11-15 19:28:12

filo5
Diamond Creator
From: Catford, London, UK
Registered: 2009-10-08
Posts: 253
Website

Re: Better GUI

Umm... What about that if you help to make the website....eeeEEEH?


http://img8.imageshack.us/img8/429/filo5newsigsg1planf.png

Offline

 

#17 2009-11-16 17:43:25

Magnie
> I am Ninja! <
From: Polaris, the planet
Registered: 2009-10-08
Posts: 321
Website

Re: Better GUI

Yes, I may boost that to programming for are website. ;)


- I speak IF Common -
  ~ Magnie Mozios ~

Offline

 

#18 2009-11-22 19:09:53

Greatdane
Member
From: Somewhere on this planet
Registered: 2009-10-20
Posts: 5
Website

Re: Better GUI

I dunno what to do? Floppy's doing the interface... And I'm not too sure how to make it work together...

And no one wants to use PythonCard anyways! I'm stuck! :(


Greatdane from scratch (DUH! :P)

Offline

 

#19 2009-11-23 15:24:01

Magnie
> I am Ninja! <
From: Polaris, the planet
Registered: 2009-10-08
Posts: 321
Website

Re: Better GUI

Why don't you just learn to use PyGame or Tkinter??


- I speak IF Common -
  ~ Magnie Mozios ~

Offline

 

Adverts

Board footer

Powered by FluxBB
Hosted by PunBB-Hosting