Re: Gtk+ newb: Some basic infos

2016-04-15 Thread Jim Charlton
I found that "Programming with gtkmm 3" (see 
https://developer.gnome.org/gtkmm-tutorial/stable/) to be very helpful.


jim...

On 16-04-14 01:58 PM, Peter Wiehe wrote:

Hello,

I want to program C++ applications with a GUI, but I am new to Gtk+ and gtkmm 
programming.


1.) What are the really important differences between Gtk+ 2 and 3?

2.) Can you recommend a really good paper book? (There seem to be a ton of Gtk+ 
2 books but not a single one about Gtk+ 3.)




Kind regards and happy coding

Peter Wiehe
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Fwd: Fw: Re[2]: argv

2016-04-15 Thread Emmanuele Bassi
Hi;

I hope you realize you're asking on the GTK+ app development list
about a problem you have when writing Assembly. To say that you're
asking on the wrong list is probably an understatement.

GTK+ only provides a C API, which is usually consumed via C; if you're
trying to use it via platform-specific Assembly then you're completely
on your own. My strong suggestion is to write a small C test case, and
look at a disassembly of a small C program looks like, if you still
want to continue trying to use the GTK+ API in Assembly.

There's another misconception you have, though, that I think explains
why you're getting answers you don't like:

On 15 April 2016 at 18:59, Andrew Robinson  wrote:

> I hope this thread makes the news. I want people to see how horrible the Linux
> community is at supporting or encouraging it's customers.

"Customer" is a person who pays somebody else for services rendered.
You are not paying anybody, here. This is a community mailing list,
and we're all volunteers, here.

Finally, I hope you considered that if nobody here has answered how to
solve your Assembly issue by now it's probably because nobody here has
tried to use GTK+ API from Assembly.

Ciao,
 Emmanuele.

-- 
https://www.bassi.io
[@] ebassi [@gmail.com]
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re[2]: Fwd: Fw: Re[2]: argv

2016-04-15 Thread Andrew Robinson
My problem is not an assembly language issue, it is a command line issue.

Anything outside of that is not an issue for me, ever.

On 4/15/2016 at 11:56 AM, Emmanuele Bassi  wrote:
>Hi;
>
>I hope you realize you're asking on the GTK+ app development list
>about a problem you have when writing Assembly. To say that you're
>asking on the wrong list is probably an understatement.
>
>GTK+ only provides a C API, which is usually consumed via C; if you're
>trying to use it via platform-specific Assembly then you're completely
>on your own. My strong suggestion is to write a small C test case, and
>look at a disassembly of a small C program looks like, if you still
>want to continue trying to use the GTK+ API in Assembly.
>
>There's another misconception you have, though, that I think explains
>why you're getting answers you don't like:
>
>On 15 April 2016 at 18:59, Andrew Robinson  wrote:
>
>> I hope this thread makes the news. I want people to see how horrible the
Linux
>> community is at supporting or encouraging it's customers.
>
>"Customer" is a person who pays somebody else for services rendered.
>You are not paying anybody, here. This is a community mailing list,
>and we're all volunteers, here.
>
>Finally, I hope you considered that if nobody here has answered how to
>solve your Assembly issue by now it's probably because nobody here has
>tried to use GTK+ API from Assembly.
>
>Ciao,
> Emmanuele.
>
>-- 
>https://www.bassi.io
>[@] ebassi [@gmail.com]

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re[2]: argv

2016-04-15 Thread Andrew Robinson
Just so there is no misunderstandings here, I want everyone to realize that
when a typical GTK+ program is selected from Windows Explorer:

1) A DOS CLI window appears
2) After a short delay, the GTK+ program appears

If you leave off the "/console" option on compilation, the DOS CLI does not
appear, but when you exit your GTK+ program, it will still be running in the
background. The only way to close it then, is to open Windows Task Manager and
kill the thread for your GTK+ application. With the "/console" option, closing
the GTK+ program still leaves the DOS CLI open and the Task Manager still
shows your program running, but when you close the DOS CLI, the program
completely exits.

This sequence of operations is why I believe Windows is "stealing" my command
line args and passing on something else that is nonsense, or that the only
real way to get the command line args with Win32 GTK+ programs is to not use
the args, but to use g_application_new(G_APPLICATION_HANDLES_COMMAND_LINE).

Thanks,

Andrew 

On 4/15/2016 at 11:35 AM, Florian Pelz  wrote:
>On 04/12/2016 01:58 PM, David Marceau wrote:
>> If you really need to resort to assembler, just run the gcc/g++ compiler
>> with the "-c -S" to generate the assembler to see how they gcc compiler
>> does it with the above gtkhello.c
>
>This here really is good advice. If you don't want to read GNU assembler
>language, then make gcc output Intel assembler syntax (see [1]).
>
>That said, you are asking for advice on a GTK+ list when your problems
>apparently have nothing to do with GTK+.
>
>[1]
>https://stackoverflow.com/questions/199966/how-do-you-use-gcc-to-generate-assembly-code-in-intel-syntax
>

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re[2]: argv

2016-04-15 Thread Andrew Robinson
I have a working program written in GoAsm for Win32 GTK+. It is a very easy
thing to do, much easier than you could imagine. I could post code, if you
wanted to see it, since it is such a simple program. I found two other people
on the Internet who have built and run GTK+ programs in assembly, both written
in NASM, both for GTK+2, and both cross-OS. I may be the only person writing a
program in GoAsm for for GTK+3 and cross-OS, but that has nothing to do with
my problem. I would be willing to discuss all of this and more with anyone who
would care to listen, but not until I get my problem resolved. That's because
if the community won't support me, why would I support the community? As you
probably already know, getting my "trivial" problem resolved is leading to
something else entirely. This is something I have repeatedly come across in
the Linux community:

1) You have a problem! I don't have that problem, you must be stupid! -- but
said in more subtle way, obviously
2) You have a problem? You have come to the right place because I know
everything, blah, blah, blah, ... sorry I couldn't help you with your problem
3) You have a problem? Your problem is something unrelated to Linux/GTK+/etc
-- is Windows anywhere on your system? Is it an obsolete 32-bit instance
instead of the vastly superior 64-bit instance? Are you using the right
compiler?

Two people in this forum have done exactly what I have listed above, so this
is no exaggeration.

Thanks,

Andrew

On 4/15/2016 at 12:30 PM, Mark Cianfaglione 
wrote:
>
>On 15/04/16 03:17 PM, Andrew Robinson wrote:
>> It is good advice but do you have a *working* or *tested* example that I
can
>> do this with using the GTK+ Win32 libraries? I don't and that is my problem
>> and it is one hundred percent a GTK+ problem because I am only using GTK+
for
>> my program.
>>
>To the community's defense I have to say that I've never seen anyone use 
>ANY Gtk from assembler in the 7+ years that I've been using it. (Other 
>than what is compiled from GCC.)
>
>Sounds like you are breaking new ground. Do keep the list posted if you 
>do manage to get it to work to add to the community based knowledge.
>
>Mark
>
>___
>gtk-app-devel-list mailing list
>gtk-app-devel-list@gnome.org
>https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: argv

2016-04-15 Thread Mark Cianfaglione


On 15/04/16 03:17 PM, Andrew Robinson wrote:

It is good advice but do you have a *working* or *tested* example that I can
do this with using the GTK+ Win32 libraries? I don't and that is my problem
and it is one hundred percent a GTK+ problem because I am only using GTK+ for
my program.

To the community's defense I have to say that I've never seen anyone use 
ANY Gtk from assembler in the 7+ years that I've been using it. (Other 
than what is compiled from GCC.)


Sounds like you are breaking new ground. Do keep the list posted if you 
do manage to get it to work to add to the community based knowledge.


Mark

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Fwd: Fw: Re[2]: argv

2016-04-15 Thread Andrew Robinson
Hi David,

I am here because I have a problem getting GTK+ to work and am seeking
community support. So I was surprised to see this off-the-record email
response from David ...



>On 4/15/2016 at 5:03 AM, David Marceau  wrote:

>You should be using 64-bit hardware by now and I encourage you to get some.
>Then try straight GNU/Linux rather than windows.  ArchLinux and Debian
>are the go-to choices in respective order of my preference.
>If all hell breaks loose and I need to use Windows, then MSYS2 is where
>I decide to land and so should you.

>If you learn about assembler,then you'll need to expose yourself to gnu
>assembler because you are eventually going to care about portability.
>Otherwise stick to c++ or golang and forget about assembler and focus
>your efforts on your problems at hand rather than smaller assembler
>instructions.  You're tripping up on very trivial stuff.  arguments.
>You would have overcome this problem in seconds if you had been using
>golang rather than assembler or gcc/g++.  The gtk stuff is doable and
>portable from golang also with gotk3 and go-gtk.

1) All my hardware is 64-bit ... that has nothing to do with my problem.

2) Are you trying to say that GTK+ doesn't work very well in Windows or that
no one in the Linux world wants to support any Windows related issues, and
that is why I should get rid of anything Windows related and move over to
Linux?

3) I do not need to know GNU assembly to understand the workings GTK+ or to
program my app. GNU is cryptic because it deviates from the machine code
language used to document microprocessor operation by ALL microprocessor
manufacturers, so it is very reasonable to not want to learn it or use it.

4) My program is portable, not because it is written in ASM but because it is
a GTK+ program. Since my program is not open source, nobody has to know.

5) A great number of DLLs and apps are 32-bit code and probably will always be
32-bit because  32-bit has some advantages that 64-bit does not. I
need some of those 32-bit DLLs as helper functions for my program. 32-bit and
64-bit DLLs cannot be mixed, I don't want to resort to COM objects or some
other such nonsense, so I settled for a 32-bit only solution for my app.

I know you have a problem with what I am doing and why I am doing it, but I am
here to solve my problems, not yours.

The bottom line is, none of your "advice" helps me to fix my "trivial"
problem, it is a dodge and evade of my problem. It still won't work and am I
basically being told to not expect any help because no one will attempt to
reproduce the issue, that no one will actually look into the issue, that I am
using the wrong programming language, that I am using the apparently inferior
Win32 GTK+ libraries, that I should be using a different OS, and then all my
problems would go away. All that advice has done is give me a very good reason
to never want to switch to Linux or any of it's derivatives.

I hope this thread makes the news. I want people to see how horrible the Linux
community is at supporting or encouraging it's customers. Thanks for turning
me off to Linux forever and I hope this thread turns many other people off to
Linux forever too. At least the community "support" I have received here
explains why, even with the extra horrible Win8 and Win10 releases, Linux
STILL cannot make a dent in the desktop OS world -- and never will.

Have a nice day,

Andrew

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re[2]: argv

2016-04-15 Thread Andrew Robinson
It is good advice but do you have a *working* or *tested* example that I can
do this with using the GTK+ Win32 libraries? I don't and that is my problem
and it is one hundred percent a GTK+ problem because I am only using GTK+ for
my program.

On 4/15/2016 at 11:35 AM, Florian Pelz  wrote:
>On 04/12/2016 01:58 PM, David Marceau wrote:
>> If you really need to resort to assembler, just run the gcc/g++ compiler
>> with the "-c -S" to generate the assembler to see how they gcc compiler
>> does it with the above gtkhello.c
>
>This here really is good advice. If you don't want to read GNU assembler
>language, then make gcc output Intel assembler syntax (see [1]).
>
>That said, you are asking for advice on a GTK+ list when your problems
>apparently have nothing to do with GTK+.
>
>[1]
>https://stackoverflow.com/questions/199966/how-do-you-use-gcc-to-generate-assembly-code-in-intel-syntax
>

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: argv

2016-04-15 Thread Florian Pelz
On 04/12/2016 01:58 PM, David Marceau wrote:
> If you really need to resort to assembler, just run the gcc/g++ compiler
> with the "-c -S" to generate the assembler to see how they gcc compiler
> does it with the above gtkhello.c

This here really is good advice. If you don't want to read GNU assembler
language, then make gcc output Intel assembler syntax (see [1]).

That said, you are asking for advice on a GTK+ list when your problems
apparently have nothing to do with GTK+.

[1]
https://stackoverflow.com/questions/199966/how-do-you-use-gcc-to-generate-assembly-code-in-intel-syntax

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: argv

2016-04-15 Thread Florian Pelz
On 04/15/2016 09:59 PM, Andrew Robinson wrote:
> I may be the only person writing a
> program in GoAsm for for GTK+3 and cross-OS, but that has nothing to do with
> my problem.

That you use GoAsm and GoLink instead of GCC can make a difference.
Different build toolchains may not be compatible. Where did you get your
GTK+ packages from? Does calling GTK+ functions even work?

Either way, the stack usage is probably the same for all 32-bit Windows
programs. In the MSYS2 GCC, argc is at ebp+8, argv is at ebp+12, so
argv[1] is retrieved like this:

moveax, DWORD PTR [ebp+12]
moveax, DWORD PTR [eax+4]

Maybe you accessed the argv array pointer instead of the array elements?

You can try it yourself on MSYS2 and compiling to assembler code like this

gcc `pkg-config --cflags gtk+-3.0` -S test.c -masm=intel

and linking like this:

gcc -o test test.s `pkg-config --libs gtk+-3.0`

I have no idea how to do this in GoAsm and I'm not going to try.

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: argv

2016-04-15 Thread Florian Pelz
On 04/15/2016 09:30 PM, Mark Cianfaglione wrote:
> […]
> To the community's defense I have to say that I've never seen anyone use
> ANY Gtk from assembler in the 7+ years that I've been using it. (Other
> than what is compiled from GCC.)
> 
> Sounds like you are breaking new ground. Do keep the list posted if you
> do manage to get it to work to add to the community based knowledge.
> 
> Mark
>

There is "Programming From the Ground Up" [1], an excellent but old book
on x86 (i.e. 32-bit) assembler programming on GNU/Linux which has a
section on using libgnomeui from the assembler. It uses the GNU
assembler's AT syntax by the way, not Intel syntax.

[1] https://savannah.nongnu.org/projects/pgubook/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re[2]: argv

2016-04-15 Thread Andrew Robinson
I already know how to program. That isn't my problem.

On 4/15/2016 at 3:46 PM, Florian Pelz  wrote:
>On 04/15/2016 09:30 PM, Mark Cianfaglione wrote:
>> […]
>> To the community's defense I have to say that I've never seen anyone use
>> ANY Gtk from assembler in the 7+ years that I've been using it. (Other
>> than what is compiled from GCC.)
>> 
>> Sounds like you are breaking new ground. Do keep the list posted if you
>> do manage to get it to work to add to the community based knowledge.
>> 
>> Mark
>>
>
>There is "Programming From the Ground Up" [1], an excellent but old book
>on x86 (i.e. 32-bit) assembler programming on GNU/Linux which has a
>section on using libgnomeui from the assembler. It uses the GNU
>assembler's AT syntax by the way, not Intel syntax.
>
>[1] https://savannah.nongnu.org/projects/pgubook/
>___
>gtk-app-devel-list mailing list
>gtk-app-devel-list@gnome.org
>https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Gtk+3 application Internationalization

2016-04-15 Thread A. da Mek

How is localisation done in the new system?


In the same way you localize your application's strings


For simple programs, I do not bother to do my own localization, because 
most of needed words are already available in localization files of GTK 
and its components. Thus I define:


#define A_(String) g_dpgettext ("atk10", String, 0)
#define L_(String) g_dpgettext ("glib20", String, 0)
#define G_(String) g_dpgettext ("gtk20", String, 0)
#define P_(String) g_dpgettext ("gtk20-properties", String, 0)

and then I can use for example:

G_("File"), P_("Image"), A_("paragraph")

and so on.

But of course, some of these words are not available in all versions.

Another possibility is to use localization files of other programs which 
also use .mo files (for example GIMP).



___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list