Re: suggestions sought for a framework for a quick, dirty, reallysimple GUI prototype

2012-07-22 Thread Oleg Goldshmidt
This has been an interesting discussion, and if you care feel free to
continue.

Summary: Qt proved quite suitable for the task. There was no deep reason to
prefer it over anything else except for the fact that no other programming
language - or process (with stdout|stdin pipe) - was involved. A colleague
who is not a developer but knows how to program thought that learning yet
another language for this task was too much. He jumped in before I could.

-- 
Oleg Goldshmidt | o...@goldshmidt.org
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: suggestions sought for a framework for a quick, dirty, reallysimple GUI prototype

2012-07-22 Thread Oleg Goldshmidt
On Thu, Jul 19, 2012 at 9:14 PM, Nadav Har'El n...@math.technion.ac.ilwrote:


 This is a very important point. This is why I loved Tcl/Tk when I
 learned it in the mid 90s


Second that. Tcl/Tk/wish was rather cool. I learned bits and pieces of it
at the same time. I still say my GUI experience is zero - whatever i have
is within the rounding errors.

-- 
Oleg Goldshmidt | p...@goldshmidt.org o...@goldshmidt.org
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: suggestions sought for a framework for a quick, dirty, reallysimple GUI prototype

2012-07-20 Thread Dov Grobgeld
Here are a few comparisons. (Note that I always prefer inheriting the main
window and thus create a derived widget. This typically requires more code,
but in return you get a real widget that integrates seamlessly into the
widget system.)

Python gtk:

#!/usr/bin/python

import gtk

class HelloWorld(gtk.Window):
def button_clicked(self, data):
print Hello World!

def __init__(self):
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)

self.connect(destroy, gtk.main_quit)

button = gtk.Button(Press me)
button.connect(clicked, self.button_clicked)
button.show()
self.add(button)

HelloWorld().show()
gtk.main()

Vala:

using Gtk;

public class HelloWorld : Gtk.Window {
construct {
this.title = Hello World;
var button = new Button.with_label(Hello world);
button.clicked.connect( () = {
stdout.printf(Hello world!\n);
});

button.show();
this.add(button);
}
}

int main(string[] args) {
Gtk.init(ref args);

var hello_world = new HelloWorld();
hello_world.show();

Gtk.main();
return 0;
}

For pyside / PyQt see:

http://www.harshj.com/2009/04/26/the-pyqt-intro/

It carries some additional noise due to the python vs qt bindings.

Regarding tcl, I once wrote a gtk/Tcl quick and dirty prototyping tool,
that may be of interest to someone. See:

http://gemshell.sourceforge.net/

Regards,
Dov
On Thu, Jul 19, 2012 at 9:14 PM, Nadav Har'El n...@math.technion.ac.ilwrote:

 On Thu, Jul 19, 2012, Dov Grobgeld wrote about Re: suggestions sought for
 a framework for a quick, dirty, reallysimple GUI prototype:
  very nicely reflects the beauty of the GObject system. Especially in C it
  is easy to miss that because of the very tedious syntax you need to use,
  e.g. to define an derived class. In Vala the syntax is very concise.

 This is a very important point. This is why I loved Tcl/Tk when I
 learned it in the mid 90s - the code to create the gui was so compact,
 so elegant - the complete opposite of Xlib, Xaw and Motif, each
 requiring you to write dozens of lines for every simple task.

 For example, here is a program in TCL/TK which shows a hello button
 which outputs hi when pressed. How does it look in your favorite
 gui language?

 #!/usr/bin/wish
 button .a -text hello -command puts hi
 pack .a

 For the curious, the first command creates a button .a - in TK, widgets
 are hierarchical and have hierarchical pathnames, with . separating
 components, so .a is a child of the toplevel window . with the name
 a. The TCL language is a simple language resembling the shell (but with
 interesting improvements, which I can eleborate if anyone cares).
 The second command packs .a in its parent, i.e., the toplevel window
 .. packing means that you ask to have .a be placed and sized
 automatically.

 I'm still saddened by the fate of TCL/TK. I still blame Sun for what
 happened to it. sun bought TCL/TK and its inventor John Ousterhout
 with intentions of turning TCL into a browser scripting language, and
 then burried TCL when Sun decided to go with Java instead (though
 interestingly, Java NEVER become a language of the web). I'm sad,
 because I was really a big fan of TCL and TK. I still am.

 Sic transit gloria mundi.

  Regarding the fact that it compiles to C, as long as I have an automatic
  build system, what do I care what it compiles to? But most other high
  language bindings to Gtk are just as easy to use (e.g. Python, Lua, or
  Haskell).

 I'm curious, why does it need to compile at all? Why didn't they just
 write an interpreter, like TCL did?

 Nadav.


 --
 Nadav Har'El| Thursday, Jul 19 2012, 1 Av
 5772
 n...@math.technion.ac.il
 |-
 Phone +972-523-790466, ICQ 13349191 |error compiling committee.c: too many
 http://nadav.harel.org.il   |arguments to function

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: suggestions sought for a framework for a quick, dirty, reallysimple GUI prototype

2012-07-20 Thread ik
On Fri, Jul 20, 2012 at 1:21 PM, Dov Grobgeld dov.grobg...@gmail.comwrote:

 Here are a few comparisons. (Note that I always prefer inheriting the main
 window and thus create a derived widget. This typically requires more code,
 but in return you get a real widget that integrates seamlessly into the
 widget system.)

 Python gtk:

 #!/usr/bin/python

 import gtk

 class HelloWorld(gtk.Window):
 def button_clicked(self, data):
 print Hello World!

 def __init__(self):
 gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)

 self.connect(destroy, gtk.main_quit)

 button = gtk.Button(Press me)
 button.connect(clicked, self.button_clicked)
 button.show()
 self.add(button)

 HelloWorld().show()
 gtk.main()

 Vala:

 using Gtk;

 public class HelloWorld : Gtk.Window {
 construct {
 this.title = Hello World;
 var button = new Button.with_label(Hello world);
 button.clicked.connect( () = {
 stdout.printf(Hello world!\n);
 });

 button.show();
 this.add(button);
 }
 }

 int main(string[] args) {
 Gtk.init(ref args);

 var hello_world = new HelloWorld();
 hello_world.show();

 Gtk.main();
 return 0;
 }

 For pyside / PyQt see:

 http://www.harshj.com/2009/04/26/the-pyqt-intro/

 It carries some additional noise due to the python vs qt bindings.

 Regarding tcl, I once wrote a gtk/Tcl quick and dirty prototyping tool,
 that may be of interest to someone. See:

 http://gemshell.sourceforge.net/


Way too much code. In Lazarus you do not need to write this code, unless
you really want to.
Object Pascal is not a dynamic language but a static language, so you can
not compare the two.
Even TP was very complex language, and today's language contain even more
features, generics, mixin, and a lot more.

The API of both Lazarus and Delphi is very close to Qt (Qt came after
Delphi).
But today both with Lazarus and Delphi you can create native code and GUI
depends on the platform.
So you do not need to know GTK, Qt, WinAPI, Android API (yes you can
compile native code to run in JVM), iOS etc...
Except of specific stuff. You just use the API. when you compile to/in
windows it will be WinAPI native, no GTK or Qt.
On Linux, you can use GTK or Qt (in compile time you choose it).
On Mac it will be native to that, on BeOS it will native to BeOS etc..

Have a look at my program (not very simple one):
https://github.com/ik5/display-quotes

Only one method with some GUI code inside for an open dialog, that i did
not want to do in a design time. everything else is about the logic, not
about the GUI.
If you will check it closely, I even have code that that add extra features
if you compile it to GTK, and extra code for Windows based requirements,
only one line of code for it.

I binded there the libnotify library arrive from Gnome/GTK. You can see the
code itself.
When you use Python, you do not use GTK, you use a way that is suitable to
Python that at the end translate into GTK.
When you use Vala, it again translate into C that is translated into
machine code.
When you use Lazarus, you use API, that call the native UI methods (like
with Python), but translated into native machine code (elf, exe, class
files).

You have a lot of components and addons in Lazarus, and it is very simple
to write code with it that will work everywhere.
But people still think that working hard and dealing with too much
dependencies on run time for normal users, is the way to go,
and learning 10 technologies to write one program, is the proper way,
or that you do not need a fast executable (the fastest in bench-marking
then GCC, intel etc.. ),
then please, by all means, keep on going the wrong way ...

Just remember that C#, Go and even C11 copied from Object Pascal most of
it's features ...

My last battle in this thread on the subject.



 Regards,
 Dov


Ido


 On Thu, Jul 19, 2012 at 9:14 PM, Nadav Har'El n...@math.technion.ac.ilwrote:

 On Thu, Jul 19, 2012, Dov Grobgeld wrote about Re: suggestions sought
 for a framework for a quick, dirty, reallysimple GUI prototype:
  very nicely reflects the beauty of the GObject system. Especially in C
 it
  is easy to miss that because of the very tedious syntax you need to use,
  e.g. to define an derived class. In Vala the syntax is very concise.

 This is a very important point. This is why I loved Tcl/Tk when I
 learned it in the mid 90s - the code to create the gui was so compact,
 so elegant - the complete opposite of Xlib, Xaw and Motif, each
 requiring you to write dozens of lines for every simple task.

 For example, here is a program in TCL/TK which shows a hello button
 which outputs hi when pressed. How does it look in your favorite
 gui language?

 #!/usr/bin/wish
 button .a -text hello -command puts hi
 pack .a

 For the curious, the first command creates a button .a - in TK, widgets
 are hierarchical and have hierarchical 

Re: suggestions sought for a framework for a quick, dirty, reallysimple GUI prototype

2012-07-19 Thread Dov Grobgeld
The advantage of using Qt or Gtk compared with some of the other gui
toolkits mentioned (fltk, Tcl/Tk, SDL, or Matlab GUI) are that they are
complete (lots of widgets, internationalization and localization support
etc) if the prototype turns into something bigger than was initially
envisioned. To often have I seen tools that were written like oh, its's
only for me and then a company is trying to figure out how to deploy and
support the tool. I therefore thing it is worth taking the time to learn
complexity of one of these GUI's, and then use it.

The language is a separate issue from the GUI. The difference between Qt
and Gtk is that Qt was from the beginning written to be tighly coupled with
C++, whereas gtk (actually the glib model) was written so that it is easy
to bind it to various languages. There is even a special GObject (the base
class of gtk) dedicated language. See:
http://en.wikipedia.org/wiki/Vala_%28programming_language%29 . True, there
are some bindings to Qt, e.g. the official python binding PySide, but the
huge amount of bindings to gtk shows that it is a much easier task.

In short, decide a language and a toolkit. Take time to learn it. It is
well worth your time.

Regards,
Dov

On Thu, Jul 19, 2012 at 12:29 PM, yochai yoc...@titat.info wrote:

 Shlomi,

 I gave it as an idea as I understood he doesn't need a full GUI or
 anything with a shiny look but to print a lot of data very fast.

 I'm sorry if I miss-understood anything.

 Yochai

 On 07/19/2012 12:12 PM, Shlomi Fish wrote:
  Hi all,
 
  On Thu, Jul 19, 2012 at 12:02 PM, yochai yoc...@titat.info wrote:
  Sorry, I thought it will be clear what I'm speaking about.
 
  https://en.wikipedia.org/wiki/Simple_DirectMedia_Layer
 
 
  I would recommend against SDL, because creating a decent GUI with it
  will require a lot of work, and on top of it will give you a giant
  window of raw graphics in the screen, which isn't very user-friendly
  or impressive. SDL is good enough for games, but not for a GUI
  application.
 
  There used to be a GUI library for SDL called ParaGUI but its home
  page is currently down. I'm not sure if it could fix all of SDL's
  limitations in regards to its usability as a GUI platform.
 
  Regards,
 
  -- Shlomi Fish
 
 
  On 07/19/2012 11:37 AM, Omer Zak wrote:
  On Thu, 2012-07-19 at 10:55 +0300, yochai wrote:
  Hey,
 
  It isn't the first idea that comes to mind but what about SDL ?
 
  How about giving an URL to a Website or a Wikipedia article, which
  describes the specific SDL that you refer to?
 
  When searching both resources, Google returned irrelevant links
  and Wikipedia was rather ambiguous.
 
  Thanks, --- Omer
 
 
 
 
  ___
  Linux-il mailing list
  Linux-il@cs.huji.ac.il
  http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
 
 
 


 ___
 Linux-il mailing list
 Linux-il@cs.huji.ac.il
 http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: suggestions sought for a framework for a quick, dirty, reallysimple GUI prototype

2012-07-19 Thread ik
On Thu, Jul 19, 2012 at 12:40 PM, Dov Grobgeld dov.grobg...@gmail.comwrote:

 The advantage of using Qt or Gtk compared with some of the other gui
 toolkits mentioned (fltk, Tcl/Tk, SDL, or Matlab GUI) are that they are
 complete (lots of widgets, internationalization and localization support
 etc) if the prototype turns into something bigger than was initially
 envisioned. To often have I seen tools that were written like oh, its's
 only for me and then a company is trying to figure out how to deploy and
 support the tool. I therefore thing it is worth taking the time to learn
 complexity of one of these GUI's, and then use it.

 The language is a separate issue from the GUI. The difference between Qt
 and Gtk is that Qt was from the beginning written to be tighly coupled with
 C++, whereas gtk (actually the glib model) was written so that it is easy
 to bind it to various languages. There is even a special GObject (the base
 class of gtk) dedicated language. See:
 http://en.wikipedia.org/wiki/Vala_%28programming_language%29 . True,
 there are some bindings to Qt, e.g. the official python binding PySide, but
 the huge amount of bindings to gtk shows that it is a much easier task.

 In short, decide a language and a toolkit. Take time to learn it. It is
 well worth your time.


The thing is, that the approach I offered - Lazarus, contain support both
to Qt and GTK, but you do not care about it in any way, you just focus on
your task, on the libraries at hand. The libraries are only matter on
compile and deployment time, not on coding, you do not really use any GTK
or Qt code, but focus on an API that exists above this.

The fight aginst Qt vs GTK is nice when you need to focus yourself on
lower level development, not with tools that simplify things to you.
Vala, is a very stupid idea. it's a C# like language that is translated
into C and then built a native code.
With Lazarus, you program in a real programming language, and instead of
using a middleware, you just cod your code, and the GUI is designed without
any line of code (unless you have to, or just want to do it like that).



 Regards,
 Dov


Ido


 On Thu, Jul 19, 2012 at 12:29 PM, yochai yoc...@titat.info wrote:

 Shlomi,

 I gave it as an idea as I understood he doesn't need a full GUI or
 anything with a shiny look but to print a lot of data very fast.

 I'm sorry if I miss-understood anything.

 Yochai

 On 07/19/2012 12:12 PM, Shlomi Fish wrote:
  Hi all,
 
  On Thu, Jul 19, 2012 at 12:02 PM, yochai yoc...@titat.info wrote:
  Sorry, I thought it will be clear what I'm speaking about.
 
  https://en.wikipedia.org/wiki/Simple_DirectMedia_Layer
 
 
  I would recommend against SDL, because creating a decent GUI with it
  will require a lot of work, and on top of it will give you a giant
  window of raw graphics in the screen, which isn't very user-friendly
  or impressive. SDL is good enough for games, but not for a GUI
  application.
 
  There used to be a GUI library for SDL called ParaGUI but its home
  page is currently down. I'm not sure if it could fix all of SDL's
  limitations in regards to its usability as a GUI platform.
 
  Regards,
 
  -- Shlomi Fish
 
 
  On 07/19/2012 11:37 AM, Omer Zak wrote:
  On Thu, 2012-07-19 at 10:55 +0300, yochai wrote:
  Hey,
 
  It isn't the first idea that comes to mind but what about SDL ?
 
  How about giving an URL to a Website or a Wikipedia article, which
  describes the specific SDL that you refer to?
 
  When searching both resources, Google returned irrelevant links
  and Wikipedia was rather ambiguous.
 
  Thanks, --- Omer
 
 
 
 
  ___
  Linux-il mailing list
  Linux-il@cs.huji.ac.il
  http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
 
 
 


 ___
 Linux-il mailing list
 Linux-il@cs.huji.ac.il
 http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il



 ___
 Linux-il mailing list
 Linux-il@cs.huji.ac.il
 http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: suggestions sought for a framework for a quick, dirty, reallysimple GUI prototype

2012-07-19 Thread Shlomi Fish
Hi Dov,

On Thu, Jul 19, 2012 at 12:40 PM, Dov Grobgeld dov.grobg...@gmail.com wrote:
 The advantage of using Qt or Gtk compared with some of the other gui
 toolkits mentioned (fltk, Tcl/Tk, SDL, or Matlab GUI) are that they are

You should not lump SDL together with FLTK, Tcl/Tk and Matlab GUI,
because it is not a GUI library, not intended to be
one. Reading from http://en.wikipedia.org/wiki/Simple_DirectMedia_Layer :


Simple DirectMedia Layer (SDL) is a cross-platform, free and open
source multimedia library written in C that presents a simple
interface to various platforms' graphics, sound, and input devices.

SDL has the word layer in its title because it is actually a wrapper
around operating-system-specific functions. The main purpose of SDL is
to provide a common framework for accessing these functions. For
further functionality beyond this goal, many libraries have been
created to work on top of SDL.[1]


 complete (lots of widgets, internationalization and localization support
 etc) if the prototype turns into something bigger than was initially
 envisioned. To often have I seen tools that were written like oh, its's
 only for me and then a company is trying to figure out how to deploy and
 support the tool. I therefore thing it is worth taking the time to learn
 complexity of one of these GUI's, and then use it.

Right, many one-off tools tend to outgrow their original purpose.

Regards,

Shlomi Fish

-- 
--
Shlomi Fish http://www.shlomifish.org/

Electrical Engineering studies. In the Technion. Been there. Done
that. Forgot a lot. Remember too much.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: suggestions sought for a framework for a quick, dirty, reallysimple GUI prototype

2012-07-19 Thread Dov Grobgeld
On Thu, Jul 19, 2012 at 12:50 PM, ik ido...@gmail.com wrote:

 Vala, is a very stupid idea. it's a C# like language that is translated
 into C and then built a native code.


I disagree. I am not familiar with C# so I can't comment on that, but Vala
very nicely reflects the beauty of the GObject system. Especially in C it
is easy to miss that because of the very tedious syntax you need to use,
e.g. to define an derived class. In Vala the syntax is very concise.
Regarding the fact that it compiles to C, as long as I have an automatic
build system, what do I care what it compiles to? But most other high
language bindings to Gtk are just as easy to use (e.g. Python, Lua, or
Haskell).

 With Lazarus, you program in a real programming language, and instead of
 using a middleware, you just cod your code, and the GUI is designed without
 any line of code (unless you have to, or just want to do it like that).


Sorry, I'm not familiar with Lazaurus, but it seems to be based on Pascal.
Unless it's Pascal dialect has changed completely  since my TurboPascal
days, it is still a language that is inferior to e.g. Python or Vala. Don't
know what you mean by not having to design the GUI. If you want it to
look in a certain way you have to specify that.




 Regards,
 Dov


 Ido


 On Thu, Jul 19, 2012 at 12:29 PM, yochai yoc...@titat.info wrote:

 Shlomi,

 I gave it as an idea as I understood he doesn't need a full GUI or
 anything with a shiny look but to print a lot of data very fast.

 I'm sorry if I miss-understood anything.

 Yochai

 On 07/19/2012 12:12 PM, Shlomi Fish wrote:
  Hi all,
 
  On Thu, Jul 19, 2012 at 12:02 PM, yochai yoc...@titat.info wrote:
  Sorry, I thought it will be clear what I'm speaking about.
 
  https://en.wikipedia.org/wiki/Simple_DirectMedia_Layer
 
 
  I would recommend against SDL, because creating a decent GUI with it
  will require a lot of work, and on top of it will give you a giant
  window of raw graphics in the screen, which isn't very user-friendly
  or impressive. SDL is good enough for games, but not for a GUI
  application.
 
  There used to be a GUI library for SDL called ParaGUI but its home
  page is currently down. I'm not sure if it could fix all of SDL's
  limitations in regards to its usability as a GUI platform.
 
  Regards,
 
  -- Shlomi Fish
 
 
  On 07/19/2012 11:37 AM, Omer Zak wrote:
  On Thu, 2012-07-19 at 10:55 +0300, yochai wrote:
  Hey,
 
  It isn't the first idea that comes to mind but what about SDL ?
 
  How about giving an URL to a Website or a Wikipedia article, which
  describes the specific SDL that you refer to?
 
  When searching both resources, Google returned irrelevant links
  and Wikipedia was rather ambiguous.
 
  Thanks, --- Omer
 
 
 
 
  ___
  Linux-il mailing list
  Linux-il@cs.huji.ac.il
  http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
 
 
 


 ___
 Linux-il mailing list
 Linux-il@cs.huji.ac.il
 http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il



 ___
 Linux-il mailing list
 Linux-il@cs.huji.ac.il
 http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il



___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: suggestions sought for a framework for a quick, dirty, reallysimple GUI prototype

2012-07-19 Thread Shlomi Fish
Hi Ido,

On Thu, Jul 19, 2012 at 12:50 PM, ik ido...@gmail.com wrote:
 On Thu, Jul 19, 2012 at 12:40 PM, Dov Grobgeld dov.grobg...@gmail.com
 wrote:

 The advantage of using Qt or Gtk compared with some of the other gui
 toolkits mentioned (fltk, Tcl/Tk, SDL, or Matlab GUI) are that they are
 complete (lots of widgets, internationalization and localization support
 etc) if the prototype turns into something bigger than was initially
 envisioned. To often have I seen tools that were written like oh, its's
 only for me and then a company is trying to figure out how to deploy and
 support the tool. I therefore thing it is worth taking the time to learn
 complexity of one of these GUI's, and then use it.

 The language is a separate issue from the GUI. The difference between Qt
 and Gtk is that Qt was from the beginning written to be tighly coupled with
 C++, whereas gtk (actually the glib model) was written so that it is easy to
 bind it to various languages. There is even a special GObject (the base
 class of gtk) dedicated language. See:
 http://en.wikipedia.org/wiki/Vala_%28programming_language%29 . True, there
 are some bindings to Qt, e.g. the official python binding PySide, but the
 huge amount of bindings to gtk shows that it is a much easier task.

 In short, decide a language and a toolkit. Take time to learn it. It is
 well worth your time.


 The thing is, that the approach I offered - Lazarus, contain support both to
 Qt and GTK, but you do not care about it in any way, you just focus on your
 task, on the libraries at hand. The libraries are only matter on compile and
 deployment time, not on coding, you do not really use any GTK or Qt code,
 but focus on an API that exists above this.

The problem is that Lazarus is based on Free Pascal, which may have
problem wrapping C++ code which is what Oleg wanted originally.


 The fight aginst Qt vs GTK is nice when you need to focus yourself on
 lower level development, not with tools that simplify things to you.

Fight?

 Vala, is a very stupid idea. it's a C# like language that is translated into
 C and then built a native code.

Why is it a stupid idea? I recall re-implementing a small Perl program
(which ran too slowly) in Vala, and it performed much better, so I was
happy. I have not done any GUI programming in Vala, but translating
something to C is a valid approach.

 With Lazarus, you program in a real programming language, and instead of
 using a middleware, you just cod your code, and the GUI is designed without
 any line of code (unless you have to, or just want to do it like that).


Are you implying that Vala is not a real programming language?

Regards,

-- Shlomi Fish

-- 
--
Shlomi Fish http://www.shlomifish.org/

Electrical Engineering studies. In the Technion. Been there. Done
that. Forgot a lot. Remember too much.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: suggestions sought for a framework for a quick, dirty, reallysimple GUI prototype

2012-07-19 Thread ik
On Thu, Jul 19, 2012 at 2:01 PM, Shlomi Fish shlo...@gmail.com wrote:

 Hi Ido,

 On Thu, Jul 19, 2012 at 12:50 PM, ik ido...@gmail.com wrote:
  On Thu, Jul 19, 2012 at 12:40 PM, Dov Grobgeld dov.grobg...@gmail.com
  wrote:
 
  The advantage of using Qt or Gtk compared with some of the other gui
  toolkits mentioned (fltk, Tcl/Tk, SDL, or Matlab GUI) are that they are
  complete (lots of widgets, internationalization and localization support
  etc) if the prototype turns into something bigger than was initially
  envisioned. To often have I seen tools that were written like oh, its's
  only for me and then a company is trying to figure out how to deploy
 and
  support the tool. I therefore thing it is worth taking the time to learn
  complexity of one of these GUI's, and then use it.
 
  The language is a separate issue from the GUI. The difference between Qt
  and Gtk is that Qt was from the beginning written to be tighly coupled
 with
  C++, whereas gtk (actually the glib model) was written so that it is
 easy to
  bind it to various languages. There is even a special GObject (the base
  class of gtk) dedicated language. See:
  http://en.wikipedia.org/wiki/Vala_%28programming_language%29 . True,
 there
  are some bindings to Qt, e.g. the official python binding PySide, but
 the
  huge amount of bindings to gtk shows that it is a much easier task.
 
  In short, decide a language and a toolkit. Take time to learn it. It is
  well worth your time.
 
 
  The thing is, that the approach I offered - Lazarus, contain support
 both to
  Qt and GTK, but you do not care about it in any way, you just focus on
 your
  task, on the libraries at hand. The libraries are only matter on compile
 and
  deployment time, not on coding, you do not really use any GTK or Qt code,
  but focus on an API that exists above this.

 The problem is that Lazarus is based on Free Pascal, which may have
 problem wrapping C++ code which is what Oleg wanted originally.


I might have misread it, but as I understand, he thinking on C++ because of
the GUI.



 
  The fight aginst Qt vs GTK is nice when you need to focus yourself on
  lower level development, not with tools that simplify things to you.

 Fight?


All other suggestions are either Qt vs GTK vs FLTK etc...
I offered to ignore the type of all of it.



  Vala, is a very stupid idea. it's a C# like language that is translated
 into
  C and then built a native code.

 Why is it a stupid idea? I recall re-implementing a small Perl program
 (which ran too slowly) in Vala, and it performed much better, so I was
 happy. I have not done any GUI programming in Vala, but translating
 something to C is a valid approach.


If what you understood is true, and he is looking for a C++ solutions, why
do you keep offering Python or Vala to him ?
If I understand it, then my solution is better, instead of using a language
to help use a toolkit, I offer a language with tools
that helps you develop GUI without the hassle of choosing the GUI toolkit,
but to focus on your work, and think in DRY land ...

If he choose Glade with GTK, he needs to start to think in grid like way of
writing.
If he chooses Qt with Qt-Develop, he will need to write a template, and
then focus on understanding Qt

I offer something different, different thinking, even know, without any
knowledge of gui development, or even the programming language,
a simple window, edit box, a button and a simple menu will take him less
then 10 minutes. When he'll know to use it, it will take him 3-5 minutes
tops.



  With Lazarus, you program in a real programming language, and instead of
  using a middleware, you just cod your code, and the GUI is designed
 without
  any line of code (unless you have to, or just want to do it like that).
 

 Are you implying that Vala is not a real programming language?


*Vala* is an object-oriented
http://en.wikipedia.org/wiki/Object-oriented programming
language http://en.wikipedia.org/wiki/Programming_language with a
self-hosting http://en.wikipedia.org/wiki/Self-hosting
compilerhttp://en.wikipedia.org/wiki/Compilerthat generates
C http://en.wikipedia.org/wiki/C_%28programming_language%29 code and uses
the GObject http://en.wikipedia.org/wiki/GObject system.  
http://en.wikipedia.org/wiki/Vala_%28programming_language%29

It's a descriptive language for C, that was built to help you develop GUI
for GTK, and looks too much like C# (it's actually cool language C#, much
better then Java, but that's off topic).



 Regards,

 -- Shlomi Fish

 --
 --
 Shlomi Fish http://www.shlomifish.org/

 Electrical Engineering studies. In the Technion. Been there. Done
 that. Forgot a lot. Remember too much.

 Please reply to list if it's a mailing list post - http://shlom.in/reply .

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: suggestions sought for a framework for a quick, dirty, reallysimple GUI prototype

2012-07-19 Thread Oleg Goldshmidt
On Thu, Jul 19, 2012 at 12:40 PM, Dov Grobgeld dov.grobg...@gmail.comwrote:

 The advantage of using Qt or Gtk compared with some of the other gui
 toolkits mentioned (fltk, Tcl/Tk, SDL, or Matlab GUI) are that they are
 complete (lots of widgets, internationalization and localization support
 etc) if the prototype turns into something bigger than was initially
 envisioned. To often have I seen tools that were written like oh, its's
 only for me and then a company is trying to figure out how to deploy and
 support the tool. I therefore thing it is worth taking the time to learn
 complexity of one of these GUI's, and then use it.


I understand all of this and this is exactly why I stressed in the original
post that I was sure it would be thrown away. The reason is that our
product includes a very sophisticated GUI that is Windows/.NET and I do not
see  either the company or our customers to switch to, say, Linux/Qt in the
foreseeable future. So whatever we do in a demo/mockup/prototype will have
to be re-implemented in the current GUI framework. What we do not currently
have is skilled GUI development resources to participate in the prototyping
effort, so integrating the prototype with the existing GUI is out of the
question.

Therefore feature-completeness is not a consideration in this particular
case, though I fully support the philosophy in general.

Thanks to all those who have already made suggestions, and keep them
coming. I cannot keep up in real time (i.e., each time something gets
mentioned, look it up, evaluate, respond), so my lack of specific reactions
does not mean I am not paying close attention.

-- 
Oleg Goldshmidt | p...@goldshmidt.org o...@goldshmidt.org
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: suggestions sought for a framework for a quick, dirty, reallysimple GUI prototype

2012-07-19 Thread Dov Grobgeld
Both Gtk and Qt work seamlessly under Windows, and launching your tool as
an external process might be feasible.

(I did something similar at Orbotech about 15y ago when I wrote an external
tool in Perl/Tk that exactly matched the colors and fonts of the external
C++/Motif based GUI. In a certain scenario the tool would be launched and
as it was frameless it snugly overlayed part of the GUI. When the
interaction was done it was popped down, and the customers had not any clue
that they had been interacting with an external tool. :-)

Regards,
Dov


On Thu, Jul 19, 2012 at 3:01 PM, Oleg Goldshmidt p...@goldshmidt.org wrote:



 On Thu, Jul 19, 2012 at 12:40 PM, Dov Grobgeld dov.grobg...@gmail.comwrote:

 The advantage of using Qt or Gtk compared with some of the other gui
 toolkits mentioned (fltk, Tcl/Tk, SDL, or Matlab GUI) are that they are
 complete (lots of widgets, internationalization and localization support
 etc) if the prototype turns into something bigger than was initially
 envisioned. To often have I seen tools that were written like oh, its's
 only for me and then a company is trying to figure out how to deploy and
 support the tool. I therefore thing it is worth taking the time to learn
 complexity of one of these GUI's, and then use it.


 I understand all of this and this is exactly why I stressed in the
 original post that I was sure it would be thrown away. The reason is that
 our product includes a very sophisticated GUI that is Windows/.NET and I do
 not see  either the company or our customers to switch to, say, Linux/Qt in
 the foreseeable future. So whatever we do in a demo/mockup/prototype will
 have to be re-implemented in the current GUI framework. What we do not
 currently have is skilled GUI development resources to participate in the
 prototyping effort, so integrating the prototype with the existing GUI is
 out of the question.

 Therefore feature-completeness is not a consideration in this particular
 case, though I fully support the philosophy in general.

 Thanks to all those who have already made suggestions, and keep them
 coming. I cannot keep up in real time (i.e., each time something gets
 mentioned, look it up, evaluate, respond), so my lack of specific reactions
 does not mean I am not paying close attention.

 --
 Oleg Goldshmidt | p...@goldshmidt.org o...@goldshmidt.org

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: suggestions sought for a framework for a quick, dirty, reallysimple GUI prototype

2012-07-19 Thread Nadav Har'El
On Thu, Jul 19, 2012, Dov Grobgeld wrote about Re: suggestions sought for a 
framework for a quick, dirty, reallysimple GUI prototype:
 very nicely reflects the beauty of the GObject system. Especially in C it
 is easy to miss that because of the very tedious syntax you need to use,
 e.g. to define an derived class. In Vala the syntax is very concise.

This is a very important point. This is why I loved Tcl/Tk when I
learned it in the mid 90s - the code to create the gui was so compact,
so elegant - the complete opposite of Xlib, Xaw and Motif, each
requiring you to write dozens of lines for every simple task.

For example, here is a program in TCL/TK which shows a hello button
which outputs hi when pressed. How does it look in your favorite
gui language?

#!/usr/bin/wish
button .a -text hello -command puts hi
pack .a

For the curious, the first command creates a button .a - in TK, widgets
are hierarchical and have hierarchical pathnames, with . separating
components, so .a is a child of the toplevel window . with the name
a. The TCL language is a simple language resembling the shell (but with
interesting improvements, which I can eleborate if anyone cares).
The second command packs .a in its parent, i.e., the toplevel window
.. packing means that you ask to have .a be placed and sized
automatically.

I'm still saddened by the fate of TCL/TK. I still blame Sun for what
happened to it. sun bought TCL/TK and its inventor John Ousterhout
with intentions of turning TCL into a browser scripting language, and
then burried TCL when Sun decided to go with Java instead (though
interestingly, Java NEVER become a language of the web). I'm sad,
because I was really a big fan of TCL and TK. I still am.

Sic transit gloria mundi.

 Regarding the fact that it compiles to C, as long as I have an automatic
 build system, what do I care what it compiles to? But most other high
 language bindings to Gtk are just as easy to use (e.g. Python, Lua, or
 Haskell).

I'm curious, why does it need to compile at all? Why didn't they just
write an interpreter, like TCL did?

Nadav.


-- 
Nadav Har'El| Thursday, Jul 19 2012, 1 Av 5772
n...@math.technion.ac.il |-
Phone +972-523-790466, ICQ 13349191 |error compiling committee.c: too many
http://nadav.harel.org.il   |arguments to function

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: suggestions sought for a framework for a quick, dirty, reallysimple GUI prototype

2012-07-19 Thread Nadav Har'El
On Thu, Jul 19, 2012, ik wrote about Re: suggestions sought for a framework 
for a quick, dirty, reallysimple GUI prototype:
 *Vala* is an object-oriented
 http://en.wikipedia.org/wiki/Object-oriented programming
 language http://en.wikipedia.org/wiki/Programming_language with a
 self-hosting http://en.wikipedia.org/wiki/Self-hosting
 compilerhttp://en.wikipedia.org/wiki/Compilerthat generates
 C http://en.wikipedia.org/wiki/C_%28programming_language%29 code and uses
 the GObject http://en.wikipedia.org/wiki/GObject system.  
 http://en.wikipedia.org/wiki/Vala_%28programming_language%29

I looked at http://en.wikipedia.org/wiki/Vala_%28programming_language%29
and see that Vala isn't a simple for scripting GTK (which I assumed from
the original description), but something completely different: It is a
new *compiled* language with a syntax resembling C#.

The fact that Vala is compiled into C and only from there to machine
code, is immaterial. I still remember the first C++ compiler I used,
in 1988, compiled C++ code to C (see http://en.wikipedia.org/wiki/Cfront).
In that era, compiling into C was actually a fashion. Lex and Yacc
also compile into C, and so and so did quite a lot of other languages.
Why has this changed? Mainly, gcc is to blame. Gcc is open-source and
more front ends can be written to it, so compilers for Fortran, Ada,
Java, Go, and probably other languages were written as Gcc frontends.
If Gcc didn't exist, or was closed-source, my guess is that all these
compiler-writers would have compiled into *C*, and let GCC the C
compiler handle the task of converting this C into machine code on a
hundred different architectures.

 If what you understood is true, and he is looking for a C++ solutions, why
 do you keep offering Python or Vala to him ?

Because it makes for an interesting discussion :-)
I'm sure Oleg is capable of picking what he needs from this discussion.

-- 
Nadav Har'El| Thursday, Jul 19 2012, 1 Av 5772
n...@math.technion.ac.il |-
Phone +972-523-790466, ICQ 13349191 |In Fortran, God is real unless declared
http://nadav.harel.org.il   |an integer.

___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il


Re: suggestions sought for a framework for a quick, dirty, reallysimple GUI prototype

2012-07-19 Thread Udi Finkelstein
On Thu, Jul 19, 2012 at 9:14 PM, Nadav Har'El n...@math.technion.ac.ilwrote:

 I'm still saddened by the fate of TCL/TK. I still blame Sun for what
 happened to it. sun bought TCL/TK and its inventor John Ousterhout
 with intentions of turning TCL into a browser scripting language, and
 then burried TCL when Sun decided to go with Java instead (though
 interestingly, Java NEVER become a language of the web). I'm sad,
 because I was really a big fan of TCL and TK. I still am.

 Sic transit gloria mundi.


FYI, TCL is still the standard scripting language in VLSI EDA tools, when
an embedded language is needed:

Synopsys use it for Design Compiler and probably other Physical Synthesis
tools and maybe even DVE (their front end GUI for design verification)
Magma (now part of synopsys)
IBM Booledozer (part of their ASIC toolset)
Modelsim simulation tools
Mentor Graphics
Cadence

In fact, it's hard to find an EDA tool vendor NOT embedding a TCL
interpreter in his toolset.

Udi
___
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il