Re: [jruby-user] Re: Help For JrubyFX

Benjamin Gudehus <[email protected]> Fri, 6 Mar 2015 17:29:30 +0100
Newsgroups gmane.comp.lang.jruby.user
Message-ID <CANdUZf933AwUySZJGWteFb+f-L=dMC-_7QXdF9O7y_bTpAkE0g@mail.gmail.com>
The scene.fill = nil is missing in your code. Try this:

~~~ruby
class HelloWorldApp < JRubyFX::Application
  def start(stage)
    stage.fxml HelloWorldController
    stage.initStyle(StageStyle::TRANSPARENT)
    stage.scene.fill = nil
    stage.title = "Hello World!"
    stage.width = 800
    stage.height = 600
    stage.show
  end
end
~~~

References:
http://www.adam-bien.com/roller/abien/entry/completely_transparent_windows_stage_in

On Fri, Mar 6, 2015 at 5:07 PM, Parham Taheri <[email protected]> wrote:

> Thank you very much for the help my problem was resolved
> But I have another problem
> i wanna to make a window look like this
> http://i.cubeupload.com/Zfogxo.png
> but when i make this window with jrubyfx i cant transparent full
> background
> so for me is this
> http://i.cubeupload.com/pK5nUr.png
>
> My .rb code
>
> require 'jrubyfx'
> import "javafx.stage.StageStyle"
> import "javafx.application.Application"
> import "javafx.scene.Scene"
> import "javafx.scene.layout.VBox"
> import "javafx.scene.text.Font"
> import "javafx.scene.text.Text"
> import "javafx.stage.Stage"
>
> fxml_root File.dirname(__FILE__)
>
>
> class HelloWorldApp < JRubyFX::Application
>
>
>     def start(stage)
>           stage.fxml HelloWorldController
>           stage.initStyle(StageStyle::TRANSPARENT)
>           stage.title = "Hello World!"
>           stage.width = 800
>           stage.height = 600
>           stage.show
>     end
> end
>
> class HelloWorldController
>   include JRubyFX::Controller
>   fxml "Hello.fxml"
>     def event_exit
>         stage = @pane1.getScene().getWindow()
>         stage.close()
>
>     end
> end
>
> HelloWorldApp.launch
>
> And My .fxml code
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <?import javafx.geometry.*?>
> <?import javafx.scene.image.*?>
> <?import java.lang.*?>
> <?import java.util.*?>
> <?import javafx.scene.control.*?>
> <?import javafx.scene.layout.*?>
> <?import javafx.scene.paint.*?>
> <?import javafx.scene.text.*?>
>
> <Pane fx:id="pane1" cacheShape="false" focusTraversable="true"
> maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity"
> minWidth="-Infinity" prefHeight="600.0" prefWidth="800.0"
> style="-fx-background-image: url(&quot;Bg1.gif&quot;);
> -fx-background-size: 800 600; -fx-background-position: center center;
> -fx-background-repeat: stretch;" xmlns="http://javafx.com/javafx/8"
> xmlns:fx="http://javafx.com/fxml/1">
>    <children>
>       <Button fx:id="btn1" layoutX="382.0" layoutY="41.0"
> mnemonicParsing="false" onMouseClicked="#event_exit" text="Exit" />
>       <TextField fx:id="hello_label" layoutX="325.0" layoutY="545.0" />
>    </children>
> </Pane>
>
> and my bg1.png
> http://i.cubeupload.com/Jrw34A.gif
>
> please help me and fix my code
>
> Attachments:
> http://www.ruby-forum.com/attachment/10565/Bg1.gif
>
>
> --
> Posted via http://www.ruby-forum.com/.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>