preview: Plua OO GUI Framework

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

preview: Plua OO GUI Framework

David McNab
Hi Plua folks,

I've been tinkering away with an OO application framework for Plua2,
with an API influenced by SuperWaba's as well as other toolkits I've
used.

It's early days yet, but I've got the basic framework working fine, with
what I believe is a reasonably simple and understandable API.

I'm posting here some code which uses this framework to implement a
basic 'hello, world' program, to give people an idea of what the API
looks like (at this stage of the project anyway). Note again that it's
for Plua v2 (which implements Lua v5).

I'd be welcoming of feedback on the 'look and feel' of the API, as used
by this demo app.

Cheers
David

demo app code follows

-- demoapp.lua
-- a demo app which uses my Pluav2 OO app framework


-- subclass the MainWindow class to create
-- our app class

myapp = MainWindow:new{

     title = "guitest window",

     -- constructor method - creates the layout
     onStart = function(self)

         -- create a widget container
         self.c = Container:new{
             parent=self,
             x=0, y=20,
             }

         -- and add a couple of widgets to it
         self.but1 = Button:new{
             parent=self.c,
             x=10, y=20,
             label="Button1",
             }

         self.but2 = Button:new{
             parent=self.c,
             x=10, y=40,
             label="Button2",
             }

         -- create a text field
         self.fld1 = Edit:new{
             parent=self,
             x=20, y=90,
             lines=1, cols=20, max=40,
             text="val",
             editable=true,
             }

         -- and finally, the quit button
         self.butQuit = Button:new{
             parent=self,
             x=65, y=140,
             label="Quit",
             }

     end,

     -- event handler method
     onEvent = function(self, ev)

         -- quit if the 'quit' button has been pressed
         if ev[1] == ui.ctlSelect
         and ev[2] == self.butQuit.id then
             self:exit()
         end

     end,

}

-- now launch the app
myapp:run()







 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply | Threaded
Open this post in threaded view
|

Re: preview: Plua OO GUI Framework

bh77a
David,

This looks interesting.  Will you make it available upon completion or are you taking
testers for it?  Would love to take a look at it.  

Thanks,
Brian
bh(at)terraworld.net

--- In [hidden email], "daviddmcnab" <david@...> wrote:

>
> Hi Plua folks,
>
> I've been tinkering away with an OO application framework for Plua2,
> with an API influenced by SuperWaba's as well as other toolkits I've
> used.
>
> It's early days yet, but I've got the basic framework working fine, with
> what I believe is a reasonably simple and understandable API.
>
> I'm posting here some code which uses this framework to implement a
> basic 'hello, world' program, to give people an idea of what the API
> looks like (at this stage of the project anyway). Note again that it's
> for Plua v2 (which implements Lua v5).
>
> I'd be welcoming of feedback on the 'look and feel' of the API, as used
> by this demo app.
>
> Cheers
> David
>
> demo app code follows
>
> -- demoapp.lua
> -- a demo app which uses my Pluav2 OO app framework
>
>
> -- subclass the MainWindow class to create
> -- our app class
>
> myapp = MainWindow:new{
>
>      title = "guitest window",
>
>      -- constructor method - creates the layout
>      onStart = function(self)
>
>          -- create a widget container
>          self.c = Container:new{
>              parent=self,
>              x=0, y=20,
>              }
>
>          -- and add a couple of widgets to it
>          self.but1 = Button:new{
>              parent=self.c,
>              x=10, y=20,
>              label="Button1",
>              }
>
>          self.but2 = Button:new{
>              parent=self.c,
>              x=10, y=40,
>              label="Button2",
>              }
>
>          -- create a text field
>          self.fld1 = Edit:new{
>              parent=self,
>              x=20, y=90,
>              lines=1, cols=20, max=40,
>              text="val",
>              editable=true,
>              }
>
>          -- and finally, the quit button
>          self.butQuit = Button:new{
>              parent=self,
>              x=65, y=140,
>              label="Quit",
>              }
>
>      end,
>
>      -- event handler method
>      onEvent = function(self, ev)
>
>          -- quit if the 'quit' button has been pressed
>          if ev[1] == ui.ctlSelect
>          and ev[2] == self.butQuit.id then
>              self:exit()
>          end
>
>      end,
>
> }
>
> -- now launch the app
> myapp:run()
>







 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply | Threaded
Open this post in threaded view
|

Re: Re: preview: Plua OO GUI Framework

David McNab
bh77a wrote:
> David,
>
> This looks interesting.  Will you make it available upon completion or are you taking
> testers for it?  Would love to take a look at it.  

I've stuck up a tarball (for *nix or Cygwin environment) with
everything, the OO framework, manual and several small examples. Check
the Plua yahoogroup, and look for folder 'Classes' in the Files section.
My framework is called OPlua, short for Object-Oriented Plua.

Apologies to those still stuck on windows - the framework requires gcc,
python and make. But with a bit of cunning and tinkering, you should be
able to convert to .BAT files to get everything working fine.

Cheers
David




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply | Threaded
Open this post in threaded view
|

Re: preview: Plua OO GUI Framework

bh77a-2
Hi David,

This is probably a stupid question, but none of the code using the OO framework can be
written on the Palm can it?  Unfortunately, that is the only environment that I use for
coding.

Thanks,
Brian

--- In [hidden email], David McNab <david@...> wrote:

>
> bh77a wrote:
> > David,
> >
> > This looks interesting.  Will you make it available upon completion or are you taking
> > testers for it?  Would love to take a look at it.  
>
> I've stuck up a tarball (for *nix or Cygwin environment) with
> everything, the OO framework, manual and several small examples. Check
> the Plua yahoogroup, and look for folder 'Classes' in the Files section.
> My framework is called OPlua, short for Object-Oriented Plua.
>
> Apologies to those still stuck on windows - the framework requires gcc,
> python and make. But with a bit of cunning and tinkering, you should be
> able to convert to .BAT files to get everything working fine.
>
> Cheers
> David
>






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply | Threaded
Open this post in threaded view
|

Re: preview: Plua OO GUI Framework

bh77a-2
In reply to this post by David McNab
Hi David,

The documentation says that OPlua.prc needs to be installed on the Palm.  Can't seem to
find it within the download package.  Which folder might it be in?

Thanks,
Brian

--- In [hidden email], David McNab <david@...> wrote:

>
> bh77a wrote:
> > David,
> >
> > This looks interesting.  Will you make it available upon completion or are you taking
> > testers for it?  Would love to take a look at it.  
>
> I've stuck up a tarball (for *nix or Cygwin environment) with
> everything, the OO framework, manual and several small examples. Check
> the Plua yahoogroup, and look for folder 'Classes' in the Files section.
> My framework is called OPlua, short for Object-Oriented Plua.
>
> Apologies to those still stuck on windows - the framework requires gcc,
> python and make. But with a bit of cunning and tinkering, you should be
> able to convert to .BAT files to get everything working fine.
>
> Cheers
> David
>






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply | Threaded
Open this post in threaded view
|

Re: Re: preview: Plua OO GUI Framework

David McNab
In reply to this post by bh77a-2
bh77a wrote:
> Hi David,
>
> This is probably a stupid question, but none of the code using the OO framework can be
> written on the Palm can it?  Unfortunately, that is the only environment that I use for
> coding.

It was written specifically for the palm and tested on the palm.

David

>
> Thanks,
> Brian
>
> --- In [hidden email], David McNab <david@...> wrote:
>> bh77a wrote:
>>> David,
>>>
>>> This looks interesting.  Will you make it available upon completion or are you taking
>>> testers for it?  Would love to take a look at it.  
>> I've stuck up a tarball (for *nix or Cygwin environment) with
>> everything, the OO framework, manual and several small examples. Check
>> the Plua yahoogroup, and look for folder 'Classes' in the Files section.
>> My framework is called OPlua, short for Object-Oriented Plua.
>>
>> Apologies to those still stuck on windows - the framework requires gcc,
>> python and make. But with a bit of cunning and tinkering, you should be
>> able to convert to .BAT files to get everything working fine.
>>
>> Cheers
>> David
>>
>
>
>
>
>
>
>  
> Yahoo! Groups Links
>
>
>
>  
>
>
>
>
>



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/plua/

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/