User Profile
Collapse
-
Never mind i figured it out. -
Return class(a) pointer in another class(b) function
So i've been working on a program in c++ that uses classes, and i am having a few problems with returning a class value from another class's function.
So i have a class called X, which is essentially a class that defines a linked list, and has some of the basic operations. In that class i have a '[]' operator that is overloaded with each value in the linked list. The operator can also override values in the linked list using
... -
thanks for the help guys, your comments saved me a lot of time.Leave a comment:
-
C-AVR programming and saving to epprom
so i started learning avr-c programming a few weeks ago and i'm a little confused about using the eeprom so save values.
i've been working a snake game for my project, and i need to save everything at any point to the eeprom so that the user can load it from that spot again.
but first i've been receiving warnings in regard to the way i've been trying to save the the highscore
Code:#include <avr/eeprom.h> eeprom_write_word(1,
-
-
turning a string into an equation
so i have an entry frame where i want to input an equation, and i need to turn the string into an actual equation in terms of x. so that i can plot it on a canvas.
i already know how to make the entry frame, and how to extract the string equation that was inputed.
the only problem i'm having is converting it into an actual equation.
e.g.
the string input is 'sin(x)'
and i want to turn it into sin(x)
x is... -
IT WORKED!!! and i'm finally finished with all the stuff i needed to do. thanks for all your help during the past week boxfish. you saved me a lot of time and stress....Leave a comment:
-
ok, so i've pretty much finished everything, but i'm having a little problem with creating a popup dialog box.
i've defined a new class called DialogBox which looks like this
Code:class DiaglogBox: def __init__(self, master): if self.entryframe.win==True: self.win() else: self.lose()
Leave a comment:
-
-
ok so i've run into a problem with the code you gave me. when i click clear. it runs the clear definition that was defined in the entryframe class. however it will only delete the first entry in the GUI's frame and not the other three..Leave a comment:
-
thanks for the help boxfish.
if i run into anymore problems i'll let you knowLeave a comment:
-
nevermind i got it to work in the end, by adding this in
Code:entryDigits = [] for i in self.entries: entryDigits.append(i.get()) for i in entryDigits: if i=='': entryDigits.remove(i)
Leave a comment:
-
so i overrode the process entries to call the setStatus function, and everything seems to be working. however
Code:entryDigits = [] for i in self.entries: entryDigits.append(int(i.get()))
Leave a comment:
-
is this what had. i think it's a little different to what you are saying i should do
Code:class View(EntryFrame): def __init__(self, parent, num): EntryFrame.__init__(self, parent, num) self.pack(anchor=W) def setStatus(self): n=0 for i in self.entries: if i in self.entries[n+1:]: #not too sure on this part self.statustext.set('Status:
Leave a comment:
-
just one more question, and it quite a long one, but don't understand how inheritence works much
so here's the full code of the EntryFrame class
[code]
Code:DIGITS=4 class EntryFrame(Frame): """A widget base class for entering a list of digits Constructor: EntryFrame(parent, num) - parent is the parent widget and num is the number of digits to be entered.
Leave a comment:
-
yeah it turns out that the code you gave me earlier did work, i just didn't pack it into the frame.
thanks for you help boxfish...Leave a comment:
-
thank you, boxfish for replying. however that seems to have no effect on it whatsoever.
i can specify a parent in another class if i want to, but i'm not sure how to do that. again i'm still a noob when it comes to programming....Leave a comment:
-
Tkinter, and calling other classes
Hi,
i'm kind of new at programming, so i was just wandering if anyone can help me with a little problem that i've been having for a couple of hours now.
i have a piece of code that's was given to me like this and can't be touched:
----------------------------------------------------------
Code:DIGITS=4 class EntryFrame(Frame): """A widget base class for entering a list of digits
No activity results to display
Show More
Leave a comment: