[Gambas-user] webhtml click event

Mayost Sharon sharon at 455.co.il
Tue Mar 7 07:34:52 CET 2023


Hello

Thank you very much

Your example helped me a lot.

Many thanks again

---------- Original Message -----------
From: Bruce Steers <bsteers4 at gmail.com>
To: Gambas Mailing List <user at lists.gambas-basic.org>
Sent: Tue, 7 Mar 2023 02:26:40 +0000
Subject: Re: [Gambas-user] webhtml click event

> On Mon, 6 Mar 2023 at 20:00, Mayost Sharon <sharon at 455.co.il> wrote:
> 
> > Hello
> >
> > I saw all the videos (very nice)
> > But I didn't see it explaining how to create a WebHTML click event
> > And I didn't understand what CSS has to do with creating events
> >
> > If I still need a click event in WebHTML how do I do it?
> > Is the only way only through source code?
> >
> > Thanks
> >
> 
> I thought you wanted a WebButton but with text on the other side?
> 
> I attach a simple example where i have imported the WebButton.class into my
> project from gb.web.gui source.
> 
> I removed EVERY function from the class except the _Render() method.
> I put the first (make Image) part into a method called RenderImage()
> I put the last (make menu arrow) part into a method called RenderArrow()
> 
> I added a "Invert" property.
> 
> I then made it write either
> Image - Text - Arrow  (Default)
> or
> Arrow - Text - Image (if Inverted)
> 
> It works for compact buttons but not for expanded ones as when inverted the
> image is center but the text is align.left.
> I added 2 buttons with images and set Invert on one of them.
> I had to place the buttons into panels to shrink them to get over the
> align.left problem.
> 
> this is only a simple example but shows how you can easily modify an object
> to your own needs.
> 
> It is what you said you initially wanted , a button with the text to the
> left of the image.
> 
> You must study some of the gb-web-gui object code.
> You complain that you are being pointed to code you do not understand, but
> that's the point, YOU MUST understand.
> 
> I did not understand when i first started using web-gui, but then it starts
> to make sense.
> and you will realize gb.web.gui is very different to gb.gui and it will
> always be.
> gb.web.gui is very minimal in features, mostly because all it can do is
> produce HTMl/JS code.
> 
> If you wish to get more advanced objects you really must learn how your
> current gb.web objects are made and how to manipulate them. They are all
> here https://gitlab.com/gambas/gambas/-/tree/master/comp/src/gb.web.gui/.src
> some are not so complicated and examining them will help you understand.
> 
> There's always a way :)
> BruceS
------- End of Original Message -------



More information about the User mailing list