Searching for websdk example(s) using SessionCSSURL

the two base examples are only using javascript. how to use the css events ?

the gravatar example uses only javascript code.
I tried to use only css but did not make it.
I would like a small example with websdk to make a simple button using css.
is it possible ?


Here’s some code that I use to do away with the default focus ring:

// Return an array of CSS URLs for your control
// Here's one way to do this...

If cssFrameworkFile = Nil Then
  cssFrameworkFile = New WebFile
  cssFrameworkFile.Filename = "myControl.css"
  cssFrameworkFile.MIMEType = "text/css" = ".myControl:focus{outline:none;}"
  cssFrameworkFile.Session = Nil // Very important, so this file will be available to all sessions
End If

Return Array( cssFrameworkFile.URL )
1 Like

thanks Anthony.
I’m quite experienced with xojo, but a complete newbie with css and javascript
I would like to make a simple wedsdk control to show a button, or another to show a listgroup using CSS. is this even possible ? I tried some things, but it always ends with nothing on the screen…

so it seems that with the CSS events, you can only alter the global app HEAD css ?
if you want to display something with websdkcontrol you must use javascript ?

You’ve always had to use HTML/JavaScript for rendering your custom WebSDK controls. The way that Web 2.0 is setup, you should build this in to your WebSDK JavaScript class definition, yes. That said, for getting GraffitiSuite up and running as quickly as possible and buy me time to rewrite on the new SDK, I built a superclass that emulates the old WebControlWrapper. In this class I’m using the first run of the Shown event to call what used to be SetupHTML and SetupJavaScriptFramework for the same effect.

The Web 2.0 SDK documentation will make a lot of things clearer when it becomes available, which won’t be far in the future now.

1 Like

ok so you first need javascript, then optionnaly css to change the global style if needed.
but where do you define the needed html for the control ?
are you forced to make all the drawings in javascript ?

Your JavaScript class definition should have a render function where you create the elements in the browser’s DOM. The currently shipped examples (with the IDE) show the structure of a WebSDK 2.0 component, you just have to fill in. Of course, the documentation will make this much easier. I spent a lot of time digging through the JS framework to build what I have, I’d suggest everyone else wait for the docs.