Author Topic: Axe GUI Library  (Read 9776 times)

0 Members and 1 Guest are viewing this topic.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7918
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Axe GUI Library
« Reply #75 on: December 28, 2011, 07:06:48 am »
No, it says safari.... :P
EDIT: Oh, in the right column it says safafi! :P :P :P :P
« Last Edit: December 28, 2011, 07:26:05 am by Sorunome »

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline alberthrocks

  • Moderator
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 876
  • Rating: +103/-10
    • View Profile
Re: Axe GUI Library
« Reply #76 on: December 31, 2011, 10:09:43 pm »
Is this project still active or is it dead? (It looks sooooo cool! )
It's active... but undergoing a very serious rewrite to allow unlimited possibilities. :D
We just like to keep it quiet and make the final product a surprise. ;)
Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/


Proud member of ClrHome!

Miss my old signature? Here it is!
Spoiler For Signature:
Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! :( Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. :)

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler For "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it :P)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it :P)
wxWabbitemu: 40% done (NEED MOAR FEATURES :P)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming :P)

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Axe GUI Library
« Reply #77 on: January 01, 2012, 06:02:34 am »
nice to hear, it looks really good!

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Axe GUI Library
« Reply #78 on: January 02, 2012, 04:27:38 pm »
Has this taken advantage of callbacks yet, given that Axe now has variable function calls?  All modern GUI designs these days are callback-based because it makes the programming simple and minimal.  For those that don't know what I'm talking about.  Suppose you want to create a dialog box with a yes and no option.  You could do something like:

Dilog("Are you sure?",LMYes,LMNo)

This would create a dialog with the text "Are you sure?" and when the "Yes" button is clicked, calls the label MYes and when "No" or cancel is clicked, calls the label MNo.  This is just an example implementation, but I wonder if its similar?
« Last Edit: January 02, 2012, 04:28:12 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline alberthrocks

  • Moderator
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 876
  • Rating: +103/-10
    • View Profile
Re: Axe GUI Library
« Reply #79 on: January 02, 2012, 10:10:18 pm »
Has this taken advantage of callbacks yet, given that Axe now has variable function calls?  All modern GUI designs these days are callback-based because it makes the programming simple and minimal.
Indeed we are. ;) However, with this:
Dilog("Are you sure?",LMYes,LMNo)
That would be an example of over-doing it! ;)

This would create a dialog with the text "Are you sure?" and when the "Yes" button is clicked, calls the label MYes and when "No" or cancel is clicked, calls the label MNo.  This is just an example implementation, but I wonder if its similar?
To fully answer this post... I know for a fact that wxWidgets does not do it this way, but it's C++, an OOP language, which Axe does not feature.... yet. ;)

So for a better comparison, I'll use a C based toolkit which has some OOP principles implemented in the background (hint hint: something that we're aiming for!) for proper comparison.

If we look at GTK+, a very popular C GUI toolkit, we have GtkMessageDialog. (See the API here. This link points exactly to the section I refer to below.)

If you look at gtk_dialog_run(), it shows how might this be used. Let's display it here:
Code: [Select]
gint result = gtk_dialog_run (GTK_DIALOG (dialog));
switch (result)
  {
    case GTK_RESPONSE_ACCEPT:
       do_application_specific_something ();
       break;
    default:
       do_nothing_since_dialog_was_cancelled ();
       break;
  }
gtk_widget_destroy (dialog);
We don't use callbacks in this case; instead, we take a result integer and compare it to another, preferably through predefined variables (in this case, GTK_RESPONSE_ACCEPT).

For those not versed in C, a pretty Python example (PyGTK) is shown below.
Code: [Select]
        dialog = gtk.MessageDialog(self, 0, gtk.MESSAGE_QUESTION,
            gtk.BUTTONS_YES_NO, "Are you sure you want to exit?")
        dialog.format_secondary_text(
           "We don't want you to lose any data.")
        response = dialog.run()
        dialog.destroy()
        if response == gtk.RESPONSE_YES:
            gtk.main_quit()
        elif response == gtk.RESPONSE_NO:
            print "Not exiting."

However, a case where callbacks may be (or rather, should be) used is when you create a window with all sorts of widgets inside.
For the sake of simplicity, I'll show PyGTK code.

**********************************
* Hello world!               [X] *
**********************************
* +--------+                     *
* | Button |                     *
* +--------+                     *
**********************************


Code: [Select]
import gtk

class PyApp(gtk.Window):

    def __init__(self):
        super(PyApp, self).__init__()
     
        self.set_title("Hello world!")
        self.set_size_request(250, 200)
        self.set_position(gtk.WIN_POS_CENTER)

        self.connect("destroy", gtk.main_quit)

        self.fixed = gtk.Fixed()
        self.add(self.fixed)
       
        button = gtk.Button("Button")
        button.set_size_request(80, 35)
        button.connect("clicked", self.on_clicked) # There's the callback! :)
 
        self.fixed.put(button, 50, 50)
     
        self.set_tooltip_text("Window widget")
        button.set_tooltip_text("Button widget")

        self.show_all()
    def on_clicked(self, widget): # This handle the event
        dialog = gtk.MessageDialog(self, 0, gtk.MESSAGE_QUESTION,
            gtk.BUTTONS_YES_NO, "Are you sure you want to exit?")
        dialog.format_secondary_text(
           "We don't want you to lose any data.")
        response = dialog.run()
        dialog.destroy()
        if response == gtk.RESPONSE_YES:
            gtk.main_quit()
        elif response == gtk.RESPONSE_NO:
            print "Not exiting."

PyApp()
gtk.main()

We, of course, can get even more complex by talking about the different ways you could handle events - GTK+ uses signals and callbacks, Qt signals and slots, wxWidgets an "event table" and regular callbacks (scroll down). Kinda crazy, eh? :P I think our plan is to do the "signals and callbacks" method, since it's the simplest to implement and possibly use. :)



Finally, a note to all: we follow the rule "show, don't tell" simply because we like giving surprises (who doesn't? :D), but also it gives us freedom to work on it any time without any deadline pressures. ;) And if it does die - possible, but not likely - no one can be really disappointed because we never offered any expectations in the first place.

This project is undergoing a significant rewrite - we used to do something like this:
Code: [Select]
AddButton(A,1,2)
While Z!=15
getKey->Z
If Z=1
Y+1->Y
End
. etc...
If Z=19 .or whatever ENTER is
DlgBox("Hello world!")
End

Doing it this way would make it impractical, verbose, and just a pain to make a GUI with.
Hence, we went for a complete redesign, with sophisticated planning so that you guys will enjoy the new, refined AGL once it's released! :D
As always, the foundation builds the house, NOT the roof nor the pretty furniture - and we're focusing on that foundation. ;)

If you are really good at Axe, have a passion for GUI toolkits, and would like to help, come on board! :D We could use all the help we can get! Either reply in this topic or PM me and you'll get added in. If possible, showcase some of your previous best works (like a resume :P).

A new year.... a new chance for infinite possibilities! :D
Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/


Proud member of ClrHome!

Miss my old signature? Here it is!
Spoiler For Signature:
Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! :( Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. :)

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler For "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it :P)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it :P)
wxWabbitemu: 40% done (NEED MOAR FEATURES :P)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming :P)

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Axe GUI Library
« Reply #80 on: January 02, 2012, 10:26:27 pm »
uh...you lost me.
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline alberthrocks

  • Moderator
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 876
  • Rating: +103/-10
    • View Profile
Re: Axe GUI Library
« Reply #81 on: January 03, 2012, 07:40:50 pm »
uh...you lost me.
Heh, I'm probably a bad explainer then :P

Basically, the way you build a GUI is to have a "container" to hold the "widgets", starting from the base and up.
When you want to make something interactive - say, if I click a button, I get a popup window - then you have to use a function to "connect" a signal and a callback.

Here's a possible future Axe GUI Library example: (I do not use 5 char label names here since they are very ambiguous)
.AXEGUI
InitGUI(GUIV) .Sets up the GUI system
AddWindow(GUIV, WINV, "Hello world!", 1) .Creates a "fullscreen" window
AddLabel(WINV, LBLV, "Click that button!") .Creates a label
AddButton(WINV, BTNV, "Click me!") .Creates a button

.Let's make it interactive!
Connect(BTNV, 1, LOnClick) .Set up button so that when it's clicked, the label OnClick is called.
ShowGUI() .Show the GUI/mouse.
DestroyGUI() .Delete the GUI once done
Return .Exit

Lbl OnClick
MsgBox("Hey! What a cool MsgBox this is!") .Show a dialog box (MsgBox)
Return .Exit from subroutine


If you're still confused, please tell me and I'll try to clarify. (That may mean the current API must be complex... :P)
« Last Edit: January 03, 2012, 07:41:23 pm by alberthrocks »
Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/


Proud member of ClrHome!

Miss my old signature? Here it is!
Spoiler For Signature:
Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! :( Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. :)

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler For "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it :P)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it :P)
wxWabbitemu: 40% done (NEED MOAR FEATURES :P)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming :P)

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: Axe GUI Library
« Reply #82 on: January 05, 2012, 10:25:52 am »
Oh, that makes a lot of sense. Sorry, I was just kind of in a hurry when I "read" that first post of yours. Looking back, it makes sense too. I probably should have read it hehe.

But yeah, that looks sweet. I'm way excited for this!
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)