
PB for Windows binding to GTK?
I didn't say it's not possible.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.
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

fsw sez:
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.
fsw also sez:
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:
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.

fsw also sez:
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.Start learn the different API's
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:
@Shannara; Too late. PB is already dependent on the Windows graphics API. You couldn't even run an console window without it.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.

Sorry if I didn't make myself clear enough.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.
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

fsw sez:

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...Regarding my example (I'm speaking of the PureBasic GUI Toolkit):

BasicGuy wrote:fsw sez:
Shannara sez:@Shannara; Too late. PB is already dependent on the Windows graphics API. You couldn't even run an console window without it.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.
Yeah, but no dependencies outside of any Windows OS.. big difference between the VB runtime libraries which is an addon to the program

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.
-
- PureBasic Expert
- Posts: 2812
- Joined: Fri Apr 25, 2003 4:51 pm
- Location: Portugal, Lisbon
- Contact:
8OFred 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.

