How to drag and drop an image out of Electron on Next.js? - next.js

I'm struggling to get drag & drop functionality to run in Electron when it wraps Next.js. I follow an official Electron tutorial on d&d and base my code on an example in the official Next.js repo. I was able to get d&d working in a quick start Electron app after following the steps described in an official example.
The issue I'm having is that when I drag a file outside of an Electron application to Finder, only a .fileloc or .webloc file is being dragged, not the file I send with sendDrag.
I'm not sure why is it happening. Could it be that d&d out of Electron is supported only when the browser window loads a file with loadFile, not a url with loadURL? In that case, I'm not sure how can I run exported html Next.js files without a server...

Alright, turned out I forgot to add event.preventDefault(). This is the commit with the fix https://github.com/cbrwizard/nexj.js-with-electron-typescript/commit/e3fba369287c7506263c36db36ada0c61246808b#diff-5a46010a5570ab7e32855454c53ccc06bd1f7b08e2099db4ff3a3f0c584e3f05R31

Related

WebStorm Firebase Integration

I'm pretty new to Firebase, and Web Development in general. Does anyone know how to avoid errors like these in WebStorm?
Ideally I would like to be able to point Webstorm towards some resource so it recognizes these functions. Everything works and this is technically just an annoyance, but I haven't been able to find a solution.
To link Firebase as a library in WebStorm's JavaScript project do as follows:
Hit Ctrl+Alt+S to open Settings page.
Open page Language & Frameworks > JavaScript > Libraries
Hit ADD... button on right
Fill name as firebase
Hit + and Attach Directories
Find your node_modules\#firebase folder inside current project
You can OK twice to confirm and close Settings page
Now your Firebase is recognized by WebStorm and all #types are defined, and you can Ctrl+Click any function, and get code completion!
Best regards!
Adding firebase as a dependency to package.json and then doing npm install should do the trick – WebStorm fill index the source files and provide code completion for Firebase APIs.
Alternatively, you can download firebase-app.js and firebase-auth.js from the CDN and then configure them as a Library in WebStorm as described in the docs.

How to use open file dialog in xamarin forms

Please help me, I want to pick the pdf file locally in xamarin forms(cross platform). So on a button click i need to open the file dialog to pick pdf file locally.
This is not something that can be done in a true cross-platform way. For example; on iOS you cannot access the filesystem directly, while on Android and UWP you can.
I have created a NuGet Xamarin.Plugin.FilePicker (Github) (original by rafaelrmou), which tries to solve this for you. On iOS you need iCloud Drive to be configured.
If you do not want to use the plugin you could always look into the code and roll your own.

Handle a Button Event: index.js does not appear

I am currently going through the beginner tutorial, I have gotten to the "Handle a button event" section where it asks to open the index.js file. Where was this file supposed to be located, as well as when was it added in during the tutorial? This file does not appear when I search it.
Did you use the Typescript version of the blank Cordova template to create your project? If so that is why you would not see any index.js. Start over using the Javascript version instead of Typescript. Just create a new project as usual and find Cordova under Javascript. This happened to me.

Unity Launcher icon not being set by Qt application

I'm trying to get my Qt application to display an icon in the Unity Launcher but it's not working. In code, I'm simply using:
qApp->setWindowIcon(QIcon("path/to/icon.png"));
but it's not doing anything. I've also tried setting the icon directly on the main window but it doesn't help either.
Any idea what could be the issue?
PS: I've checked the icon path and it is correct.
Without knowing the details of unity, I'm pretty sure that you'll have to create and install a .desktop file with the icon in it. See for example here. Whatever you set at runtime, the launcher cannot know about before starting the application, so it will need the information from an external configuration.
To enable picture encoding in Windows(not in Ubuntu) I've put the QT\4.8.3\plugins\imageformats folder near my app.
I think You should try the same.

Running a JavaFX program within a web page, not launching a new window

I've seen lots of examples of JavaFX in my reading, but every JavaFX app I've seen need to be launched in a separate window. The apps don't run within a web page.
Can JavaFX applications be run within a web page, just like we would expect a Flash app (or, for that matter, an applet) to run? Is there a reason why people aren't letting JavaFX apps run within their web pages?
Is there a particular bit of HTML code that needs to be used to get a JavaFX app to run Flash/applet-style?
Yes, just build a demo JavaFX application in NetBeans. I'd be surprised if they didn't provide you with some type of 'Hello World' test app. Then take a look at the HTML page it creates.
If you run into problems getting your JavaFX app to run on a webpage, take a look at this question. The short story is that you can't just copy jar files and copy and paste the appropriate HTML into your webpage. You need to include the JNLP file NetBeans creates, and you have to edit some of the NetBeansy stuff in the JNLP file.
Yep, just use run application as Java Applet. NetBeans will deploy all FX stuff correctly for all platforms including Java Applet.
See....
http://www.javafx.com/samples/SimpleVideoPlayer/index.html
Yes you can do it.
Look for about JNLPAppletLauncher

Resources