Please go back to the GTK standard.

General discussion for topics related to the FreeBASIC project or its community.
John Spikowski
Posts: 453
Joined: Dec 24, 2005 2:32
Location: WA - USA
Contact:

Post by John Spikowski »

Where does this qoutation come from?
From Galeon's post preceding mine.
Which RAD tools do you use for graphical desing the GUI (using GTK-server)?
ScriptBasic with the GTK-Server extension module interface. Here is an example of using ScriptBasic, Gtk and the GNOME-DB data grid widget.

Which functions and sub-libs (GLib, Pango, ...) are needed in a universal-format-basic-GTK-server header?
GTK-Server is fully scriptable. Defiine the libs you require and the functions you plan on using and start coding your application.
Last edited by John Spikowski on Dec 16, 2010 3:57, edited 2 times in total.
John Spikowski
Posts: 453
Joined: Dec 24, 2005 2:32
Location: WA - USA
Contact:

Post by John Spikowski »

Linux screen shot
Image

Code: Select all

' FreeBASIC Gtk-server Glade Example

DECLARE FUNCTION gtk LIB "gtk-server.dll" ALIAS "gtk" (byval cmd AS zstring ptr) AS zstring ptr 

DIM xml AS string
DIM win AS string
DIM this_event AS string
DIM response AS zstring ptr

gtk("glade_init")

response = gtk("glade_xml_new(" & CHR$(34) & "hello.glade" & CHR$(34) & ")")
xml = *response
gtk("glade_xml_signal_autoconnect(" & xml & ")")
response = gtk("glade_xml_get_widget(" & xml & ", " & CHR$(34) & "window1" & CHR$(34) & ")")
win = *response
gtk("gtk_server_connect(" & win & ", " & CHR$(34) & "delete-event" & CHR$(34) & ", " & CHR$(34) & "window" & CHR$(34) & ")")

Do 
  response = gtk("gtk_server_callback WAIT") 
  this_event = *response 
LOOP UNTIL this_event = "window"

hello.glade - Glade XML project file

Code: Select all

<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">

<glade-interface>

<widget class="GtkWindow" id="window1">
  <property name="visible">True</property>
  <property name="title" translatable="yes">Hello</property>
  <property name="type">GTK_WINDOW_TOPLEVEL</property>
  <property name="window_position">GTK_WIN_POS_NONE</property>
  <property name="modal">False</property>
  <property name="default_width">400</property>
  <property name="default_height">350</property>
  <property name="resizable">True</property>
  <property name="destroy_with_parent">False</property>
  <property name="decorated">True</property>
  <property name="skip_taskbar_hint">False</property>
  <property name="skip_pager_hint">False</property>
  <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
  <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
  <property name="focus_on_map">True</property>
  <property name="urgency_hint">False</property>

  <child>
    <widget class="GtkFixed" id="fixed1">
      <property name="visible">True</property>

      <child>
	<widget class="GtkLabel" id="label1">
	  <property name="width_request">122</property>
	  <property name="height_request">17</property>
	  <property name="visible">True</property>
	  <property name="label" translatable="yes">Hello World !</property>
	  <property name="use_underline">False</property>
	  <property name="use_markup">False</property>
	  <property name="justify">GTK_JUSTIFY_LEFT</property>
	  <property name="wrap">False</property>
	  <property name="selectable">False</property>
	  <property name="xalign">0.5</property>
	  <property name="yalign">0.5</property>
	  <property name="xpad">0</property>
	  <property name="ypad">0</property>
	  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
	  <property name="width_chars">-1</property>
	  <property name="single_line_mode">False</property>
	  <property name="angle">0</property>
	</widget>
	<packing>
	  <property name="x">128</property>
	  <property name="y">128</property>
	</packing>
      </child>
    </widget>
  </child>
</widget>

</glade-interface>
John
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Post by TJF »

John Spikowski wrote:
Where does this qoutation come from?
From Galeon's post preceding mine.
Sorry, I didn't find it because I searched for 'separate' and the original text is 'seperate'.

Thank you for the example. I'll have a look at this.
John Spikowski
Posts: 453
Joined: Dec 24, 2005 2:32
Location: WA - USA
Contact:

Post by John Spikowski »

TJF wrote:
John Spikowski wrote:
Where does this qoutation come from?
From Galeon's post preceding mine.
Sorry, I didn't find it because I searched for 'separate' and the original text is 'seperate'.
I didn't mean to quote Galeon out of context, I only quoted the highlight of his point.
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Post by TJF »

John Spikowski wrote:I didn't mean to quote Galeon out of context, I only quoted the highlight of his point.
BTW: you can start a quote tag using '[quote="Galeon"] ...' and you'll get this:
Galeon wrote:...
Galeon
Posts: 563
Joined: Apr 08, 2009 5:30
Location: Philippines
Contact:

Post by Galeon »

Sorry, I always have problems spelling separate :)
John Spikowski
Posts: 453
Joined: Dec 24, 2005 2:32
Location: WA - USA
Contact:

Post by John Spikowski »

Galeon wrote:Sorry, I always have problems spelling separate :)
I paused for a second wondering if I should correct the typo in my quote. ;-)

I was hoping to get the concept of universal API templates in front of you guys for review and didn't expect the correction of a miss spelled word in a quote of another forum member to take precedence. :-(
marcov
Posts: 3504
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Post by marcov »

Galeon wrote:
That was because FreeBASIC is not well known when those headers are translated.
I don't know how they come to that list, and what are the criteria. FPC has had bindings for ever, and they are not there anymore. (it used to be).

Maybe see if I can get into contact.
marcov
Posts: 3504
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Post by marcov »

John Spikowski wrote:
a separate project, but "universality" of the GTK+ headers in all programming languages supported is a good thing, it makes moving between programming languages easier
I agree!

A universal format isn't a bad idea
True!
and GTK-Server has made good progress in that area.
Strange? I thought gtkserver was some service that you can send ascii datagrams? Or isthe universal format that you used inside GTKserver, e.g. to bind the gtkserver to the real lib?

I think a set of headers in e.g. IDL would be great. It is much easier to parse with languages that don't do preprocessing.
Galeon
Posts: 563
Joined: Apr 08, 2009 5:30
Location: Philippines
Contact:

Post by Galeon »

John Spikowski wrote:
Galeon wrote:Sorry, I always have problems spelling separate :)
I paused for a second wondering if I should correct the typo in my quote. ;-)

I was hoping to get the concept of universal API templates in front of you guys for review and didn't expect the correction of a miss spelled word in a quote of another forum member to take precedence. :-(
I think miss spelled should be misspelled ;-)
John Spikowski
Posts: 453
Joined: Dec 24, 2005 2:32
Location: WA - USA
Contact:

Post by John Spikowski »

Strange? I thought gtkserver was some service that you can send ascii datagrams? Or isthe universal format that you used inside GTKserver, e.g. to bind the gtkserver to the real lib?
GTK-Server is a wrapper for a DynaCall or FFI interface to dynamic link libraries (shred objects) using a space delimited API call and it's arguments.

ScriptBasic has a GTK-Server like extension module for Windows called DYC that works much in the same way.
marcov
Posts: 3504
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Post by marcov »

John Spikowski wrote:
Strange? I thought gtkserver was some service that you can send ascii datagrams? Or isthe universal format that you used inside GTKserver, e.g. to bind the gtkserver to the real lib?
GTK-Server is a wrapper for a DynaCall or FFI interface to dynamic link libraries (shred objects) using a space delimited API call and it's arguments.
Probably, but where is the universal API you are talking about?
John Spikowski
Posts: 453
Joined: Dec 24, 2005 2:32
Location: WA - USA
Contact:

Post by John Spikowski »

marcov wrote: Probably, but where is the universal API you are talking about?
My first post on the topic. look for the link to gtk-server.cfg

I really don't see this going anywhere other than another opportunity to give me crap for try to contribute. Everything since my original post / FB example has been about me changing the spelling of a member's quote and asking questions about references responders are too lazy to scroll back a few posts to read.

I felt that the GTK-Server project made a notable effort making Gtk available to so many languages using a common definition . Most people use compilers as a performance enhancing tool so using GTK-Server doesn't make much sense when you would be linking directly with the API as the most efficient method.
Post Reply