Ask coding questions

← Back to all posts
How to get graphical output screen?
BeeJay

Hello,

I just looked at the play library for Python. For other languages, like Pascal and Swift, is it possible to also have graphical output like that? What should we do to enable graphical screen output instead of text console?

Thank you.

Regards,

~Bee

Voters
Hamster088
BeeJay
Comments
hotnewtop
BeeJay

Forget about Swift. I haven't found any swift module that is capable to initiate graphical console. Swift is too modern that it doesn't care much about console application, let alone graphical console.

theangryepicbanana

I think you can just run the code to create a graphical window and it'll appear. Ofc you can't use AppKit for Swift since that's nac os exclusive, but there are some units for Pascal builtin

BeeJay

@theangryepicbanana Do you mean the graph unit will work?

theangryepicbanana

@BeeJay uhhhh yea I think it should. It's the default package for Free Pascal so it should be included

BeeJay

@theangryepicbanana I will try it soon and report later. Thank you.

BeeJay

@theangryepicbanana There are 3 graph units provided by FPC. The main one is the classic graph unit, but it only works on DOS and Windows. It doesn't available on Linux, so it doesn't available on repl as repl is on Linux.

The alternatives are ggigraph, sdlgraph, and ptcgraph. They'are distributed along with standard FPC package for Linux. However, when I tried them on repl, they didn't work because the lack of required libraries, namely ggi, sdl, and ptc.

So, would you please add support to at least one the those graph units? Preferably the ggi one. Thank you.

theangryepicbanana

@BeeJay I can try. For the time being, can you use a different gui lib? I do believe several are included

BeeJay

@theangryepicbanana What do you mean by "gui lib"? SDL library? OpenGL library? X library? Well… are they supported on repl?

Besides those big and complex libraries are complicated to use while the graph libraries are mostly very simple. Those graph libraries are wrapper to the complex libraries anyway. Beginners alike much prefer the graph libraries since they just need to make simple games or drawing programs.

theangryepicbanana

@BeeJay well then I'll see what I can do :)

Vandesm14

You create a Pygame repl: https://repl.it/languages/pygame

BeeJay

@Vandesm14 As I said, I want to use Pascal and Swift language, not Python.

Vandesm14

@BeeJay I'm not sure. Sorry about that! I will try to find someone who knows about this and ask them to reply to this post.