PB for Windows binding to GTK?

Everything else that doesn't fall into one of the other PB categories.
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

I have to vote no :) I moved to PB to get rid of dependancies with my proggies, if these widgets were required for PBwin, then PB will have dependancies.. or one might say a VB runtime library clone... as it would be required with any window app.. yuk!
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

Inner wrote: fsw : I disagree with you, I am currently coding an application that is cross platform over 4 operating systems, thus far I have not had to touch a single api command directly except for some real low level stuff but that isn't anything to do with gui anyway.
I didn't say it's not possible.

Sure it's possible - as long you use the build in pb gui commands. 8O

If you choose to do something different (like my InputBox example above...) than you have to use OS API and with that the trouble begins...
Start learn the different API's :wink:
BasicGuy
User
User
Posts: 70
Joined: Sat Apr 26, 2003 4:37 am
Location: US

Post by BasicGuy »

fsw sez:
Even if you use the Purebasic gui toolkit - if you need certain gadget functions or gadget fonts you have to use Win32API. Example: try to code a input box and use the same font, for the text and buttons, as a messagebox would use (for consistency reasons...). Without Win32API you can't do it!


Not true. The Ariel font is an Ariel font is an Ariel font. It is, for all practical purposes, identical across platforms. If what you're describing is a look-alike *Windows-style* messagebox, then I think you're missing my point. The whole idea of accessing the GTK API in M$, OS X and LINUX *is* consistency. It looks like the GTK. Not Aqua, or Kde or Windows. The same API calls coded for each supported platform would yield *nearly* (nothing is 100%) identical visual results.

Case in point: an interesting development is php-GTK. I'm writing a graphical desktop app for a client that interfaces their desktops (PC and OS X) to their MySQL servers using only the php binary and GTK libs. I'm developing the app on a Debian Linux box running vtwm. Works fine on each platform *without changing a single piece of code* (patent pending). It looks and acts identical on each one. 8)

fsw also sez:
Start learn the different API's
Why? All you have to know are the function calls and parameters. That's the beauty of using a common graphics API. You don't have to spend a lot of time learning the guts to satisfy each and every OS it runs on. Look at OpenGL. I doubt seriously that anyone binding a language ventures much beyond the function calls. Python, Ruby, Tcl, Ada, etc, all have bindings to OpenGL.

Code up a function in PB called "_create_window" and point it at an graphics API function called "ms_create_window", "opengl_create_window" or "gtk_create_window". It doesn't matter. The only thing that changes are the parameters to the API call.

Shannara sez:
I have to vote no. I moved to PB to get rid of dependancies with my proggies, if these widgets were required for PBwin, then PB will have dependancies.
@Shannara; Too late. PB is already dependent on the Windows graphics API. You couldn't even run an console window without it. :cry:
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

BasicGuy wrote:fsw sez:
Even if you use the Purebasic gui toolkit - if you need certain gadget functions or gadget fonts you have to use Win32API. Example: try to code a input box and use the same font, for the text and buttons, as a messagebox would use (for consistency reasons...). Without Win32API you can't do it!




Not true. The Ariel font is an Ariel font is an Ariel font. It is, for all practical purposes, identical across platforms.
Sorry if I didn't make myself clear enough.

Yes I know that you can have the same looking fonts on different os.

Regarding my example (I'm speaking of the PureBasic GUI Toolkit):
If a user wants to code a inputbox that uses the same font as the messagebox, than he needs to get the messagebox font information with the os api (the font can be arial, tahoma or whatever) there is no pb command for that.
Because the computer user can change this font as he wishes (under desktop settings), the programmer can't use a fixed font name, if he wants to let the messageboxes and inputboxes look the same.
So this piece of code (to get the fontname of the messagebox ) is different on every os.
For this you have to use the CompilerIf commands to determine on which os you are and use the right os api command.


I understand what you try to do. You like to have a application that looks the same on every os.
And for this purpose GTK is probably the right choise :wink:
BasicGuy
User
User
Posts: 70
Joined: Sat Apr 26, 2003 4:37 am
Location: US

Post by BasicGuy »

fsw sez:
Regarding my example (I'm speaking of the PureBasic GUI Toolkit):
Got me to thinking. Using the GTK API would have another perk, GLADE. The GTK GUI designer. It already,(at least the version on my Debian box), outputs code for Python, C, Perl, Ada and Eiffel. Hmm. It could be adapted for PB as well... :wink:
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

BasicGuy wrote:fsw sez:

Shannara sez:
I have to vote no. I moved to PB to get rid of dependancies with my proggies, if these widgets were required for PBwin, then PB will have dependancies.
@Shannara; Too late. PB is already dependent on the Windows graphics API. You couldn't even run an console window without it. :cry:

Yeah, but no dependencies outside of any Windows OS.. big difference between the VB runtime libraries which is an addon to the program :)
BasicGuy
User
User
Posts: 70
Joined: Sat Apr 26, 2003 4:37 am
Location: US

Post by BasicGuy »

So, outside of the "academic arguments" for and against a common API like GTK, I would still like to know if it's possible to do.

Would it require massive restructuring of PB core to use GTK, wxWindows or whatever?

Perhaps the creators of PB would lend an answer? :wink:
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

It's planned to add support for GTK framework for Windows as it's done for Linux and MacOS. It will be of course optional, and not the default tooltik. It will allow 1:1 port trough all plateforms. The compiler subsystem system is already implemented in the linux compiler, as the next linux version will support GTK1.2 and GTK2 trough a compiler switch (easy, easy...), so it's only a matter of time to have the same on Windows.
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Fred wrote:It's planned to add support for GTK framework for Windows as it's done for Linux and MacOS. It will be of course optional, and not the default tooltik. It will allow 1:1 port trough all plateforms. The compiler subsystem system is already implemented in the linux compiler, as the next linux version will support GTK1.2 and GTK2 trough a compiler switch (easy, easy...), so it's only a matter of time to have the same on Windows.
8O
:mrgreen:
Image
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

This is good.

Image






Sorry Num3, borrowed your neat smiley
@}--`--,-- A rose by any other name ..
naw
Enthusiast
Enthusiast
Posts: 573
Joined: Fri Apr 25, 2003 4:57 pm

Post by naw »

Dare2 wrote:This is good.
- its better than good- great doesnt quite do it either...
Ta - N
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

I say great, because it gives everybody what they want, with the option to use native windows controls as well.. best of both worlds and no evil side effects.
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

Freds next trick: water into wine.

Except for those who didn't want wine. Their water will still be water. :wink:
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Post by Rings »

GedB wrote:Freds next trick: water into wine.

Except for those who didn't want wine. Their water will still be water. :wink:
that gave me some ideas.......
SPAMINATOR NR.1
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Rings wrote:
GedB wrote:Freds next trick: water into wine.

Except for those who didn't want wine. Their water will still be water. :wink:
that gave me some ideas.......
:lol:
Post Reply