Re: Stop alt-spacebar window menu

2009-05-28 Thread Michael L Torrie
Actually I believe it is here:
http://library.gnome.org/devel/gdk/stable/gdk-General.html#gdk-keyboard-grab
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Apparent deficiency in GtkBuilder signal connections and grouped widgets

2009-04-06 Thread Michael L Torrie
I am writing to the devel list after first posting to the regular list
about using GtkBuilder and grouped widgets like a group of radio
buttons.  The only post that really spoke to my problem mentioned that
there really isn't a way with GtkBuilder to deal nicely with groups of
widgets like radio buttons in a group way.  There's no easy way to have
one callback for an event for the whole group of radio buttons.

I can easy do this by connecting callbacks manually and supplying a
user-data parameter to specify an arbitrary id to differentiate the
radio buttons.  If I use the user-data field with GtkBuilder it tries to
use that to look up a widget in the tree, which isn't what is wanted.

This seems like an obvious deficiency in GtkBuilder.  As GtkBuilder is
being pushed as a central component of Gtk, I ask if this deficiency
will be addressed in some manner in the API, or if it already is, how
should programmers developing in GTK connect the events from grouped
widgets in a sane way?

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


Re: What does your personal GTK+ development system consist of?

2008-02-25 Thread Michael L Torrie
Wade Renzi wrote:
 Hi everyone,
 
 I'm curious as to what peoples personal GTK+
 development systems consist of. What are the most
 convenient ways of developing GTK+ without affecting
 the GTK+ applications you use every day.
 
 I ask because I recently screwed up my Ubuntu
 installation after installing GLib, Pango, ATK and
 GTK+ from source, and would like to be able to hack on
 the GTK+ widgets without breaking everything.

On Fedora 8, I just make sure I have all the -devel packages installed
and away I go.  The only time you will have problems is when you try to
build your own versions of GTK that clobber the distro ones.  If you
build to an alternative prefix, like /opt, then you should be okay.  I
recommend just staying with a recent distro and whatever they ship.
Generally speaking the latest versions of Fedora and Ubuntu are pretty
current with GTK releases.  Just use the system ones to build against.
On Ubuntu, make sure you have the necessary -dev packages installed.

 
 Thanks,
 Wade
 
 
   
 
 Be a better friend, newshound, and 
 know-it-all with Yahoo! Mobile.  Try it now.  
 http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 
 
 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Does gtk have issues with STL?

2008-02-11 Thread Michael L Torrie
Paul Davis wrote:
   EITHER make GTK/GDK/X11 calls from a single thread only OR
   use GDK_THREADS_{ENTER,LEAVE} around every (group of) GTK/GDK/X11
   call(s).

This seems to crop up all the time.  From what I recall, the use of
threads of any kind with GTK on Win32 is not supported, even with the
ENTER/LEAVE calls around every GTK/GDK call.  The only way to use
threads and GTK in win32 is to do the g_idle_add thing to trigger a
callback from the thread.

Usually trying to use threads in GTK in win32 doesn't cause memory
corruption, though, so that's a separate problem, I think.


___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: gtk application taking 6 seconds to load

2008-02-05 Thread Michael L Torrie
Sid Kapoor wrote:
 hi michael,
 
 As described in my previous post, I tried dividing the code into 7
 different parts. But the problem still persists. The problem is not
 exactly the same. Now after gtk_widget_show() of first part, it shows
 a blank dialog within 2 seconds, But the other parts (with all the
 widgets) are loaded after 5-6 seconds only.

As I said before, it looks like you are going to have to change the
architecture of your program to create the GUI in smaller chunks.  For
example, set up all the tabs initially as blank pages.  Then trap the
event for activating the page.  In that callback check to see if the
page has been created yet.  If so, then do nothing as show() will
display all the widgets.  If the page has not yet been created, create
it.   This way you are not creating pages of off-screen widgets right at
program start time.

 This is not what I want. I want to see the fully loaded tabs as soon
 as their gtk_widget_show(create_dialog_somehow()) is called.
 I even tried the following lines to refresh the gtk_main() as soon as
 gtk_widget_show() is called. This is how my main() function looks:

-- 
Michael Torrie
Assistant CSR, System Administrator
Chemistry and Biochemistry Department
Brigham Young University
Provo, UT 84602
+1.801.422.5771

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: gtk application taking 6 seconds to load

2008-01-31 Thread Michael L Torrie
Sid Kapoor wrote:
 hi all,
 
 I am having a customised linux distribution installed on a thin client
 with the following configuration.
 
 AMD LX800
 128MB RAM
 Xorg version 7.2gtk-2.0 libraries
 
 I have made a gtk application (size 830 kB) using glade-2 to generate
 code for my application. When I run this gtk application on my
 customized linux distribution, it takes almost 6 seconds to show up.
 This lapse of 6 seconds is very irritating. Can anyone suggest how to
 reduce this boot-up time of my application.

Do all GTK apps have this bootup delay?  gedit, for example?  Is there a
lot of disk activity during this 6 second startup?  If you switch to the
default GTK theme does that help?

One thing that sometimes helps (if you can parse through the noise) is
to use strace to get a dump of all the system calls.  This can help see
if it's file opens that slow you down.

 
 One more thing. Here as I have said, I am using the code generation
 feature of glade-2. There is another approach to make gtk apps. and
 that is by using the XML file made by glade. Does both these
 approaches differ in loading time of my application?

Using glade XML files certainly is the recommended way to go.  However I
doubt it will make your app start up any faster, maybe a tiny bit
slower.  So after you've found out the cause of your slow starts, then
you can move to using the XML file directly and see what happens.

 
 Thanks in advance.
 
 Regards,
 Siddharth Kapoor
 
 
 
 
 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list


-- 
Michael Torrie
Assistant CSR, System Administrator
Chemistry and Biochemistry Department
Brigham Young University
Provo, UT 84602
+1.801.422.5771

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: gtk application taking 6 seconds to load

2008-01-31 Thread Michael L Torrie
Sid Kapoor wrote:
 I have a solution, just wanted to share it with you people whether that will
 be correct or not. In my application, there are 7 different tabs with all
 the tabs are having lots of widgets. So as the application starts up, it
 loads all the widgets before returning from the function in interface.c . So
 instead of loading all the 7 tabs in the same function, I am thinking of
 dividing the code in 7 parts and showing the front tab first, with the other
 tabs loading subsequently, This will virtually create an effect as if my
 application has taken 1/7th the time it is taking now.
 
 The idea seems nice on paper, but will it work?? I just wanted to confirm
 before proceeding, as its a really big project, and will take a lot of
 effort to re-arrange the code.

That all depends on if the time is being spent realizing the widgets
(which happens when the widgets are set to show).  If this is the
case, then maybe that will improve things.  But if the time is spent
simply building the widget trees, then splitting it up the way you
describe doesn't seem like it will do any good.  Maybe you should
consider creating the contents of the tabs on demand.  Many GTK programs
I have seen use the following pattern:

def some_callback():
if not dialog: #if the dialog hasn't been created
#call some function that creates the dialog and
#sets up the callbacks for it
dialog=create_dialog_somehow()

dialog.show()
dialog.run()
do something with return results


 
 Thanks in advance.
 Siddharth Kapoor
 
 On Jan 31, 2008 4:55 PM, Michael L Torrie [EMAIL PROTECTED] wrote:
 
 Sid Kapoor wrote:
 hi all,

 I am having a customised linux distribution installed on a thin client
 with the following configuration.

 AMD LX800
 128MB RAM
 Xorg version 7.2gtk-2.0 libraries

 I have made a gtk application (size 830 kB) using glade-2 to generate
 code for my application. When I run this gtk application on my
 customized linux distribution, it takes almost 6 seconds to show up.
 This lapse of 6 seconds is very irritating. Can anyone suggest how to
 reduce this boot-up time of my application.
 Do all GTK apps have this bootup delay?  gedit, for example?  Is there a
 lot of disk activity during this 6 second startup?  If you switch to the
 default GTK theme does that help?

 One thing that sometimes helps (if you can parse through the noise) is
 to use strace to get a dump of all the system calls.  This can help see
 if it's file opens that slow you down.

 One more thing. Here as I have said, I am using the code generation
 feature of glade-2. There is another approach to make gtk apps. and
 that is by using the XML file made by glade. Does both these
 approaches differ in loading time of my application?
 Using glade XML files certainly is the recommended way to go.  However I
 doubt it will make your app start up any faster, maybe a tiny bit
 slower.  So after you've found out the cause of your slow starts, then
 you can move to using the XML file directly and see what happens.

 Thanks in advance.

 Regards,
 Siddharth Kapoor



 

 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list

 --
 Michael Torrie
 Assistant CSR, System Administrator
 Chemistry and Biochemistry Department
 Brigham Young University
 Provo, UT 84602
 +1.801.422.5771

 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list

 
 
 
 
 
 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list


-- 
Michael Torrie
Assistant CSR, System Administrator
Chemistry and Biochemistry Department
Brigham Young University
Provo, UT 84602
+1.801.422.5771

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: App blueprint, advice please!

2007-12-19 Thread Michael L Torrie
Patrick wrote:
 Lets say a customer had a detector and a pump to pump a sample through 
 it. We could write a Bash script that works something like this:
 
 -icon launches Bash script
 -sends variable  2 to pump command to pump 2 ml per minute
 -pump command sends signal to serial port or GPIB bus, etc
 -bash sends variable 230 to set the detector to wavelength 230 nm
 -bash autozeros detector
 -launches plot command
 -after that launches data process command
 -then launches database storage command
 - emails whoever, turns your coffee maker on or whateveretc..etc

Seems to me that the lingua franca of this kind of scientific instrument
control and data collection is LabView.  Most institutions already have
site license for this software.

LabView is ideal for several reasons:
- Works with most GPIB cards, indeed most interface cards come with
labview drivers
- Easy graphical environment.  Lets you chain things together (in a
similar manner to bash, actually), but it's all within the program,
rather than kludging together non-integrated programs.  Plus it's all
in-process.  No external spawning things needed, which is expensive.
- Royalty free code.  You can sell you vi programs or give them away,
or whatever.  They aren't compiled, but can be obfuscated, or not.  So
you could sell labview code that people could modify.

On the other hand, there's no reason why you couldn't use GTK and, say,
Python to do similar things provided that you have drivers for the GPIB
boards, and have a well-defined interface that you can use to easily
build modules that you can string together.  Certainly I don't believe C
is the appropriate language to do any gluing.  I would recommend python.
 Data collection modules that need to be close to the hardware can be
done in C, but the rest could easily be done in python.  If you defined
a protocol for modules to communicate with each other, then you can very
easily string modules together, hooking data out buses on one module
(object) with the data in on another module.  The GTK signals and slots
mechanism would make this quite easy to do, all in-process.

Michael


 
 It's a terrible over simplification but hopefully illustrates the idea.
 
 I only have a few hundred dollars to put towards this now but hopefully 
 by the later half of 2008 it will be a few thousand. Please feedback 
 with any thoughts you might have on this whole process. Thanks-Patrick
 
  
 
 
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 


-- 
Michael Torrie
Assistant CSR, System Administrator
Chemistry and Biochemistry Department
Brigham Young University
Provo, UT 84602
+1.801.422.5771

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


Re: C vs C++ for GTK

2007-12-12 Thread Michael L Torrie
Jon Harrop wrote:
 On Saturday 24 November 2007 22:11, Patrick wrote:
 I thought that C++ must be the way to go as it can do everything that C
 can plus plus but some heavy hitters don't seem enthused with it,
 Linus Torvalds in particular has been quoted as calling it a horrible
 language.
 
 IIRC, Linus said that specifically in the context of systems programming.
 
 My recommendation is to choose a garbage collected language for GUI work as 
 it 
 makes everything so much easier. Lots of GCd languages have GTK bindings 
 these days.

Just because a language or library implements garbage collection doesn't
mean you don't need to manage resources.  Especially when you're working
with a GUI.  It's totally possible to leak memory in Python, C# or any
other managed language if you don't know what you are doing.  It's a bit
harder, but still a problem.  Recently the Darpa autonomous vehicle
challenge was lost by one group because their C# control system was
leaking very badly, requiring a restart every 30 minutes or so.

GTKmm is based on some very nice C++ abstractions around pointers,
providing many of the same benefits as any managed language with pure
C++.  They are called smart pointers and for GUI development, they work
very very well.  I find GTK in C++ to be almost as productive as python
or C#

 
 Incidentally, has anyone tried GTK# from C# on Mono?

Yup.  It works awesomely well.  It's very clean.  Of course I can't
think of many reasons to do it anymore.  I use python most of the time now.

 


-- 
Michael Torrie
Assistant CSR, System Administrator
Chemistry and Biochemistry Department
Brigham Young University
Provo, UT 84602
+1.801.422.5771

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


Re: How to implement a UI like Microsoft Word table by GTK??

2007-12-12 Thread Michael L Torrie
li_top wrote:
 Hi all
 I have a problem to implement a UI like Microsoft Word table .
 That is , The UI have tables . User can combine 2or3 or more tables to one 
 table. How to 
 
 do this UI? Please help me .

Your question is too vague to really be answered usefully.  But it
sounds to me like you probably want to implement this kind of UI feature
using some HTML rendering widget.  Or mess about with Pango markup
inside of a rich text editing field.

 Thanks  Regardse
 Tom
 The UI like following:
 
  __
 |_|___|___||
 | |   |   ||
 | |   |   ||
 |_|___|___||
 | |   |   ||
 |_|___|___||
  
  
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 


-- 
Michael Torrie
Assistant CSR, System Administrator
Chemistry and Biochemistry Department
Brigham Young University
Provo, UT 84602
+1.801.422.5771

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


Re: JPEG image scaling

2007-12-12 Thread Michael L Torrie
[EMAIL PROTECTED] wrote:
 Are you successfully getting it loaded?How big is the picture before
 you scale?   I need example code ( even though it does not scale ) of how
 to do this.  It can be skeleton code you know,  like we don't need to
 see the proprietary stuff, just the window/panel setup, the core stuff.   I
 have heard that displaying an image uses the same techniques to display a
 movie.

Please keep replies on the list.

I'm not sure what you mean by successfully getting it loaded.  I've
loaded and scaled JPEGs in GdkPixbuf on many occasions.  It's just
standard API stuff.

http://developer.gnome.org/doc/books/WGA/graphics-gdk-pixbuf.html


 
 
 MY GOAL:   Play a movie in a  panel or hbox or whatever,  similar to a
 kiosk.   For example:  A person at a big shopping mall presses the button
 to give them directions to the food stands/restaurants.   It plays a movie
 showing the route from where they are.At this point, it would be great
 if I could play a dvd, but I will take any type to get started.  8-)

What you should be looking at is gstreamer.  the gstreamer api not only
takes care of decoding the streams (mpeg, dvd, etc), it also has
facilities for displaying the resulting video in a GTK window, or any X
window for that matter.

I searched google for gstreamer video in gtk window and got this
python code snippet, which is pretty easy to follow and apply to
whatever language you are using:

http://www.david-web.co.uk/blog/?p=166



 
 THANKS.
 
 
 
 

  Michael L Torrie  
  [EMAIL PROTECTED] 
  .edu  To 
  Sent by:  Jian Zhang  
  gtk-list-bounces [EMAIL PROTECTED]   
  @gnome.orgcc 
gtk-list@gnome.org
Subject 
  12/11/2007 11:17  Re: JPEG image scaling  
  AM





 
 
 
 
 Jian Zhang wrote:
 Hi,

 I'm trying to show an input jpeg file on a fixed area (for example an
 area of 320x320 pixels) on my LCD. What's the best way to scale it using
 gtk? I mean is there any api function that I can use?
 
 Check out the API docs for GdkPixbuf.  Basically you can load the jpeg
 into a Pixbuf, then scale it to an arbitrary size into a new GdkPixbuf
 object.  You can then throw the original away if you want, and paint
 this newly scaled pixbuf to the window, often a GtkDrawingArea.
 
 Thanks,
 jian



 

 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 
 
 --
 Michael Torrie
 Assistant CSR, System Administrator
 Chemistry and Biochemistry Department
 Brigham Young University
 Provo, UT 84602
 +1.801.422.5771
 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 
 


-- 
Michael Torrie
Assistant CSR, System Administrator
Chemistry and Biochemistry Department
Brigham Young University
Provo, UT 84602
+1.801.422.5771

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: JPEG image scaling

2007-12-12 Thread Michael L Torrie
[EMAIL PROTECTED] wrote:
 Very nice.   I will try to translate that to C and then run it.   Or maybe
 try to get a Py-GTK setup going, just to see it in action.  8-)

Check out his follow-up post too:

http://www.david-web.co.uk/blog/?p=182



-- 
Michael Torrie
Assistant CSR, System Administrator
Chemistry and Biochemistry Department
Brigham Young University
Provo, UT 84602
+1.801.422.5771

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: JPEG image scaling

2007-12-11 Thread Michael L Torrie
Jian Zhang wrote:
 Hi, 
  
 I'm trying to show an input jpeg file on a fixed area (for example an
 area of 320x320 pixels) on my LCD. What's the best way to scale it using
 gtk? I mean is there any api function that I can use?

Check out the API docs for GdkPixbuf.  Basically you can load the jpeg
into a Pixbuf, then scale it to an arbitrary size into a new GdkPixbuf
object.  You can then throw the original away if you want, and paint
this newly scaled pixbuf to the window, often a GtkDrawingArea.

  
 Thanks,
 jian
 
 
 
 
 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list


-- 
Michael Torrie
Assistant CSR, System Administrator
Chemistry and Biochemistry Department
Brigham Young University
Provo, UT 84602
+1.801.422.5771

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Developer COBOL + GTK

2007-12-09 Thread Michael L Torrie
Ronaldo Ottoni wrote:
 Hi, I am a developer of the COBOL language and would like to know if there
 is possibility of using the API GTK with the COBOL language, if there is a
 possibility, I would like to receive assistance from members.

There is a COBOL .NET compiler (would run on mono in linux fine) that
can use the GTK# bindings:

http://www.sorn.net/blog/2007/05/Wildcat-COBOL-Compiler-0.1.9-Released


 Thanks
 
 Ronaldo OTtoni
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

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


Re: memory leak in gtk

2007-11-30 Thread Michael L Torrie
c f wrote:
snip

 I have checked the GTK documentation and it states that gtk_exit free
 all resources allocated for GTK+. gtk_exit is depricated and using
 exit is recommended. I have tested both but non of them improved the
 situation (still more than 5000 leaks).

This is normal.  GTK is not going to clean up, nor can it, every single
allocation it makes.  However this is not a problem.  GTK will not leak
more and more memory over time.  Only sunk resources are leaked, such as
global data structures.

Most people who try to find leaks in their GTK programs will use a tool
like valgrind with a large gtk-specific suppression file.  A memory leak
is a memory leak, but it's only those leaks that accumulate that are a
problem.  Sometimes I'll use a memory profiler and make sure my
program's memory use doesn't increase beyond bounds.  One trick is to
rename main() and then write a temporary main() that calls the real main
thousands of times.  Over time the memory use should never exceed a
certain ceiling.  Of course with GTK being used for interactive things,
this is a bit difficult.

Anyway, google around for valgrind suppression files for GTK apps and
then give your app a shot.  You should readily be able to find your own
leaks, that really do matter.

 
 Please could you help if I missed some cleanup in my application or
 what is happening?
 
 Thanks,
 Csaba
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

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


Re: C vs C++ for GTK

2007-11-26 Thread Michael L Torrie
Benoît Dejean wrote:
 In fact the GObject library (on which GTK is based) is an example of
  how full object-orientation can be achieved in C. Of course other C++
  features like templates, operator overloading (ugh!) and namespaces
  are unique.
 
 This is totally a blocker for beginners. I've been doing some GNOME for
 years and i've never wrote any gobject thing because it didn't worth to
 waste time on it.
 
Another interesting idea is to use Vala[1] for developing Gobject code.
 This compiles to straight C and you can use the new object's api like
any other gobject-based api.  Vala's intriguing because it's a language
very much like C#, but compiles down to straight C, which can be a
really good thing.

[1] http://live.gnome.org/Vala/GTKSample

-- 
Michael Torrie
Assistant CSR, System Administrator
Chemistry and Biochemistry Department
Brigham Young University
Provo, UT 84602
+1.801.422.5771

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

Re: C vs C++ for GTK

2007-11-26 Thread Michael L Torrie
Patrick wrote:
 Hi Everyone.
 
 Sorry for the flame war bait, I know how passionate language debates 
 get  but I need some guidance. I am using PyGTK right now and I am happy 
 with it, but a day is coming soon were the speed limitations and 
 less-then-straight-forward threading will be an issue.

I don't see any reason at all why a GUI done with PyGTK should be any
slower than a GUI done with straight C.  Thus I don't see any compelling
reason to abandon Python for C or C++.

That said, however, Python sometimes isn't the right language to use for
computationally-intensive tasks.

Personally I think you are going about this the wrong way.  You could be
wanting to do premature optimization.  Rather than trying to replace
python, you should consider either extending python with C or C++, to
replace the slowest and most-used computational paths, and stick with
python for everything else. It's very easy to write python modules in C
(10 hours to learn), or C++ (Boost makes it easy to wrap C++ classes and
functions).  Alternatively you can code in C or C++ and embed Python to
drive your GUI.

 
 I figure my next move should be to learn C or C++. I would like to stay 
 up-to-date with things and I would like to be able to reuse GTK code 
 from other Apps.

When it comes to the basic API, translating a code-generated GUI between
python and C++ (with GTKmm) should be very simple.  Even translating it
to C won't be that hard either, except that you don't have an easy way
to bind callbacks to a particular instance of data without some work,
like setting data values and using the void *data argument on the callbacks.

 
 I thought that C++ must be the way to go as it can do everything that C 
 can plus plus but some heavy hitters don't seem enthused with it, 
 Linus Torvalds in particular has been quoted as calling it a horrible 
 language.

From my experience it is those that don't understand C++ and how to
wield it that describe it that way.  Torvalds is biased anyway, since
he's focused on kernel programming.

 
 I can only spend 8-12 hours a week programming, I am not a professional 
 programmer, is C++ to complicated? Is C going out of date? Am I limited 
 with C?

C++ is complicated, but not overly so.  I feel that coming from Python,
C++ is probably going to be easier for you to move to than C.

Again, though, I think

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


-- 
Michael Torrie
Assistant CSR, System Administrator
Chemistry and Biochemistry Department
Brigham Young University
Provo, UT 84602
+1.801.422.5771

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


Re: C vs C++ for GTK

2007-11-26 Thread Michael L Torrie
JAMES SCOTT wrote:
 To list members following this subject: I have a question - not a
 flame, as I try to understand the diversity of responses to this
 topic.
 
 How many of you who have suggested Patrick learn something other
 than C, know C already for yourself.  Over the course of my
 experience I have found that learning assembler and C for a given
 platform has helped me better understand and use that platform.
 Also, knowing C make picking up or reading other languages like -
 python, php, perl, and many others easier.

I agree to a point. C isn't going to teach you much about list
processing (a la LISP), domain-specific languages, lambda closures,
proper variable binding, functional programming, etc.

On the other hand, C helps one learn to manage resources explicitly
(even garbage collection can bite you if you don't understand how
resource management works), pointers, etc.

The ideal computer science program would make sure one first knows (IE
is taught) C, then some assembly, then Scheme, then Python.

 
 I'm assuming that, those of you who are pointing another way -
 already know C!  Why not let Patrick follow your well worn path
 through C/GLIB/GTK2, maybe he will come out afterwards to C++,
 Python, or some other door.

Too late for that!  Patrick's already well into Python.  Python is a
great language to learn on, in my opinion.  It's as instructive as
learning LISP or Scheme, but as useful as C or C++, or even Java.  I get
the impression that Patrick already has some C proficiency.

 
 Yes, my preference is C/GLib/Gtk+.  But I use lots of other when needed.

I'm coming to the opinion that a good rule of thumb is just to always
use python unless specific needs dictate otherwise.  Writing GUI code in
a low-level, compiled language just doesn't seem to be the wisest thing
to do these days.

That's not to say that you're advice to learn assembly and C isn't good.
 In fact it's important for all computer programmers to know, in my opinion.

When I have to write in C, Glib is a godsend.  And of course GTK+ for
the GUI.  Using Glib, I wrote a very complicated data parsing program
using dynamic strings, hash tables, and tree structures all with Glib
and only had one very small memory leak in 10,000 lines of code and
building and destroying many trees.


-- 
Michael Torrie
Assistant CSR, System Administrator
Chemistry and Biochemistry Department
Brigham Young University
Provo, UT 84602
+1.801.422.5771

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


Re: Building and packaging for Windows - theme?

2007-11-05 Thread Michael L Torrie
Daniel Atallah wrote:
 On 11/1/07, Andrew Smith [EMAIL PROTECTED] wrote:
 Thanks everybody. I managed to build ISO Master on mingw and run it on a
 stock Windows box (just copied some dlls from the mingw bin directory),
 looks like the GTK parts work fine. Still, I'll be sure to look at all
 the examples that you pointed out.
 
 You copied some mingw dlls? That doesn't sound right.

mingwm10.dll is usually required for thread support.


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


Re: GTK++ development environment for Solaris/x86

2007-10-01 Thread Michael L Torrie
Hai LE wrote:
 Dear GTK+ org,
 
 Where could I found the GTK+ libraies, includes for
 developping under Solaris/x86 ?

Solaris 10 ships with certain versions of the GTK 2.x libraries, and the
development kit contains the header files, I believe.

But if the shipped version isn't current enough, you can either find
3rd-party solaris packages to install (check sunfreeware.com) or compile
the gtk source tarballs and install them in /usr/local.

If you install to /usr/local, just be aware that you have to set the
PKG_CONFIG_PATH variable to point to /usr/local/lib/pkgconfig when
compiling so you link to the right libraries.


 
 Thanks for your help.
 
 H.L
 
 
 
 
   
 _ 
 Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: 16 bits grayscale images

2007-09-30 Thread Michael L Torrie
alex wrote:
 Actually I am porting a Windows .NET software to GTK.
 So some procedure I use (as false color convertion) is written. I will
 use it as is because it's not depending on GTK or else...

Are you porting it to GTK# and C# then?

 
 Anyway...
 First I create a color structure wich define 256 different color from
 cold to hot.
 Then I convert my 16 bits image to a 8 bit and for each pixels value I
 replace with the corresponding color.
 It's help a lot for understanding a picture. I also add a conversion
 scale (for example to convert only values between from 100 to 256)
 
 I can post the code used, but _for the moment_ it still use .NET and
 FreeImage library, but algorythm remains the same
 
 
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

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


Re: Porting terminal applications to GTK

2007-09-28 Thread Michael L Torrie
Unix OS wrote:
 Hello,
 
 I'm an undergraduate student at James Madison University.  I've
 decided to convert one of my CS classes to an Honors class, which
 involves doing some sort of extra project typically.  Anyway, I've
 been working with my professor, and he wants to try porting his text
 editor to a windowed application that can run on Windows.  I figured
 GTK would be a great place to start.
 
 Enough back story.
 
 What's involved in converting  a terminal application like a text
 editor into a windowed application?  Will I need to simply need to
 write a custom widget to wrap the terminal application's output? Then
 redirect keyboard and mouse events to the original code?  Or is it
 more involved than that?
 
 I know Vim can be compiled to run as a GTK app.  I figure the original
 terminal-only code must have been reused.

You could use libvte (I think that's it) which is a terminal widget, and
then run the editor, unmodified, in another process, outputting and
receiving input from the terminal widget.

As the other poster mentioned, unless the app being ported is written in
a modular way with a separation of data, control, and presentation,
porting it to a GUI is difficult.  This is because typically older
console apps are procedural, whereas GUI apps are typically
event-driven.  Don't forget other gotchas too, such as OS-specific
calls, directory path separators (/ vs \), etc.

 
 
 Thanks,
 Kris Kalish
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

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


Re: 16 bits grayscale images

2007-09-27 Thread Michael L Torrie
Sergei Steshenko wrote:
 Then, could you please elaborate how GIMP converts input 16 bits per color
 per pixel TIFF/PNG into internal representation ?

Gimp simply can't deal with 16bpp, even internally.  So it'd have to
chop the channels down when importing.  This problem is why the filmgimp
fork was created years ago.

 
 If I tell GIMP to open such a files, the first thing it does is the 
 conversion,
 without asking me for any LUT that would allow it to put that valuable
 input data into its internal buffers.

Not sure what this has to do with the OP's question.  He wants to be
able to display the data on one hand, and keep it natively 16bpp on the
other hand (for manipulation). Thus he needs a 16bpp internal
representation, regardless of the display.  How gimp performs this
conversion and subsequent data loss is irrelevant.

 
 Thanks,
   Sergei.
 
 Applications From Scratch: http://appsfromscratch.berlios.de/
 
 

 
 Looking for a deal? Find great prices on flights and hotels with Yahoo! 
 FareChase.
 http://farechase.yahoo.com/
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: implementing a delayed busy cursor

2007-08-05 Thread Michael L Torrie
Paul Fox wrote:
 paul davis wrote:
   On Sun, 2007-08-05 at 12:56 -0400, Paul Fox wrote:
   
   google gtk timeout - gtk_timeout_add - gtk.org/api - Main Loop 
   Events - gtk_timeout_add has been deprecated since version 2.4 and
   should not be used in newly-written code. Use g_timeout_add() instead.
   
   and no, these run synchronously with the main loop, which is why they
   are safe to use.
 
 thanks -- i'll do some reading.  at the moment, i'm not sure how
 this will work.  if i set a gtk timeout for 1 second, but my
 program's think time is 10 seconds, then i won't get back to
 the event loop until after that, and i've therefore blown my
 intended timeout.

During this think time, the GTK main loop cannot run, so yes, your
timeout won't fire.  But at the same time your app won't respond to the
user either.  It's just going to appear to be hung.  This is generally
considered bad.

 
 but i've probably just given myself away as the gtk newb that i
 am, and am probably missing something really obvious, so i'll go
 do some reading, like i said.
 
 (i'm actually kind of surprised there's no gdk_window_set_cursor_after_delay()
 call, for just this purpose. :-)

Even if there was, it wouldn't do any good in this case, as your app is
spending those 10 seconds hogging the CPU, and never giving control to
the main loop. So it wouldn't possibly have a chance to run, even if
such a call existed.

Just a note of caution.  Threaded programming with GTK has be careful.
 Calling GTK calls from threads is problematic, and not cross-platform
to boot.  The recommended way is probably to use g_idle_add calls from
the thread to notify the GUI loop of things, and using asyncqueues (a
glib primitive) to pass data back and forth between the long-running
task and the gui.

Either that, or iterate the GTK main loop every so often from within
your long-running task.

Michael


 
 paul
 =-
  paul fox, [EMAIL PROTECTED] (arlington, ma, where it's 74.1 degrees)
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Learn GTK

2007-07-24 Thread Michael L Torrie
Xavier Queralt Mateu wrote:
 Hi,
 
 I'm an informatics student and I would like to learn GTK. I've written
 some GTK programs for the university thanks to some manuals and reading
 the API, but I'm not really happy with them. I mean, they work as I want
 but I would like to learn how to write good code, something that I could
 not found in any manual arround there (almost all are only HelloWorld's
 and this kind of programs). What can I do? Buy a GTK book or it is best
 starting to read some code?

Which language do you want to program in?  GTK has nice bindings for a
variety of languages.

For C, I recommend the tutorials on GTK's web site.  For other
languages, usually there are some small tutorials for the bindings.  For
example, google for python gtk tutorial to get you started.

Years ago I bought a book on developing (in C) with GTK+ 1.2 and it was
immensely helpful.  So a book that deals with GTK+ 2.x would probably be
useful and illustrative.

These days I still do some programming in GTK in C and C++, most most of
it is now in Python.  I've decided to program almost exclusively, where
possible, in python, writing modules in C or C++ as appropriate.
Certainly developing GUIs seems ideal for Python.

cheers,
Michael



 
 Thanks for the help,
 
 Xavier Queralt
 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: How can i write multiple windows(MDI)

2007-07-05 Thread Michael L Torrie
On Tue, 2007-07-03 at 18:31 +0100, Robert Pearce wrote:

 Cases where the child windows are not separate documents, but separate
 parts of a single entity. Yes, you can do something like this with
 multiple separate top-level windows, but then you have to rely on the
 window manager to recreate the user's chosen layout, which isn't so
 certain, and in any case it places the wrong emphasis on the GUI.

I agree that having lots of independent, top-level windows can be a
problem in cases like this.  But windows within windows aren't the
answer.  Invariably users maximize the child windows mainly because in
most cases (Visual Studio was a prime example), the real estate left for
child windows was so little after the toolbars and docks were in place,
that there just isn't enough space to manipulate little mini windows.
So no one that I know of actually uses MDI in a way that indicates MDI
is actually useful.  So in almost all cases where you'd be tempted to
implement MDI with windows in windows, why not use tabs to switch
between documents?  Visual Studio went there, eclipse went there, etc.
I wouldn't at all be surprised to see LabView do that too.  

 
 For some examples of the sort of product I'm thinking of, look at ATI
 Vision from Accurate Technologies, or INCA from ETAS, or LabView
 from National Instruments (though the last is less obvious).
 
I maintain they could have done the interface without MDI child windows,
perhaps using a tabbed document area, and we'd all be so much better
off.

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: gtk or pygtk

2007-06-14 Thread Michael L Torrie
On Thu, 2007-06-14 at 02:45 -0700, varun_shrivastava wrote:
 hi
 i want to know whether gtk
 is better or pygtk is better
 
 in terms of programming, execution time etc.

You're asking the wrong question.  What I think you're asking is, which
is a better language to use for GTK development? C or Python?  Or C++
(GTKmm) or Java (Java-gnome)?  That's not really a GTK-specific
question; it's more of a language preference question.  

In my opinion, Python is the only way to fly for building the GUI
components of apps.  The cpu-intensive things probably need to be done
in C or C++. Fortunately with Python it is very easy to mix C and Python
code.  Using GTK in Python (with the pygtk bindings) is very nice.  

That said, GTK development in straight C is actually not bad at all.
GTK's structure is very object-oriented and easy to use.

 
 
 thanks

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: gtk or pygtk

2007-06-14 Thread Michael L Torrie
On Thu, 2007-06-14 at 15:44 -0300, Alexandre Moreira wrote:

 Exactly. If you can keep up with the weird syntax and understand what
 is going on with pointer-intensive C code, I guess you'll do pretty
 well with C Gtk+. I like it better than other bindings, but that is a
 matter of taste.
 
 I believe you should check other options too, Gtkmm seems to be pretty
 good for C++ programmers and I heard good things of Gtk# if you don't
 mind using the Mono runtime.
 
 That said, keep in mind that the amount of code needed to write basic
 stuff in C Gtk+ is pretty big, so you would be happy to write or have
 a few boiler-plate generator scripts (take a look at GOB2 and spuug).


libglade is very nice to reduce boiler-plate C code.  Actually I use
libglade in all my languages, which right now are C, C++, Python, and
C#.

If you want to make your own gobject-based class files, either for your
own purposes or to extend a Gtk Widget, GOB2 is nice.  Another thing to
check out is vala[1].  vala is getting more and more useful at building
Gobject-based code using a language that's very much like c#, but
compiles directly to C code, allowing your classes to be trivially
wrapped and used in any language that has GTK bindings.

Python's GTK bindings make it very easy to extend an existing GTK class,
but you can't typically use the extended classes outside of python.
Well that's not completely true.  Using the python C extension API, you
can easily use the classes from C or C++, but it's not quite the same
thing as what vala does.

Michael

[1] http://live.gnome.org/Vala

 
 Regards,
 Alexandre Moreira.
 
 
  
  
   thanks
 
  ___
  gtk-list mailing list
  gtk-list@gnome.org
  http://mail.gnome.org/mailman/listinfo/gtk-list
 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: A humble request

2007-05-30 Thread Michael L Torrie
On Wed, 2007-05-30 at 22:45 +0530, Sundararaman wrote:
 1) I *cannot* log in successfully with my account. This means that I am
 currently not a member of this mailing list. I do not know why I am still
 getting all these emails.

Not his doesn't mean that at all.  In fact most list subscribers have
never set their password at all on Mailman.  What you might try is to
have mailman e-mail you your current password (which may be random), and
then use that to log into the Mailman interface and see what's going on.
First I would disable mail delivery, then see about doing the
unsubscribe thing again.

 
 2) I *got* a confirmation mail that I have been unsubscribed from this
 mailing list.
 
  
 
 
 
 I beseech to you, for the love of god, please show me a way out. I shall be
 much grateful to anybody who can lead me the way out.
 
  
 
 Thanks,
 
 Sundar
 
  
 
 
 
 --
 Free pop3 email with a spam filter.
 http://www.bluebottle.com
 
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

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


Re: GTK+ on Mac OS X

2007-05-25 Thread Michael L Torrie
On Fri, 2007-05-25 at 20:27 +0200, Richard Hult wrote:
 It is moving along pretty nicely currently, there are a couple of bigger 
 issues that need sorting out (most notably popups with grabs), but it's 
 getting there.
 
 Regarding pygtk, that should work pretty much like C apps, there is 
 nothing special involved.

Although Leopard is just about to be released, I am still on Panther.
In the bug tracker there is a list of Tiger-specific calls that prevent
GTK from being compiled on Panther.  That ticket was closed.   Are there
any bug tracking tickets that would track the implementing of
work-around code for avoiding these calls?  Has anyone commented on the
possibility of working around these calls? IE does GTK really need to
use these calls or is there another way to do it?

Also, has the  linker bug mentioned in the original panther compile  bug
report (number escapes me right this minute, and I can't find it with
the bug tracker search) been addressed in the build system?  This was
mainly a Panther issue to begin with, though.

Michael

 
 Regards,
 Richard
 

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


Re: GTK+ on Mac OS X

2007-05-25 Thread Michael L Torrie
On Fri, 2007-05-25 at 21:34 +0200, Richard Hult wrote:
 Michael L Torrie wrote:
  Although Leopard is just about to be released, I am still on Panther.
  In the bug tracker there is a list of Tiger-specific calls that prevent
  GTK from being compiled on Panther.  That ticket was closed.
 
 Yes, it was marked as a duplicate of another report that has a patch, 
 #408518.
 
  Also, has the  linker bug mentioned in the original panther compile  bug
  report (number escapes me right this minute, and I can't find it with
  the bug tracker search) been addressed in the build system?  This was
  mainly a Panther issue to begin with, though.
 
 I'm not sure what linker issue you are referring to. If someone wants to 
 work on getting things to work on 10.3, I can try to help out but I 
 don't plan to do it myself in the near future. A good start would be to 
 make sure the above mentioned patch is up to date and that the whole 
 stack builds.

The linker issues are mentioned in #322372.  They have to do with the
-syslibroot flag on ld.  Apparently a bug in Panther's ld.  Guess things
got a lot further than in 322372 since it at least now builds with that
patch.

http://bugzilla.gnome.org/show_bug.cgi?id=322372#c6

I will give the build a shot sometime in the next month or so.

Thanks for the update.



 
 Regards,
 Richard
 

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


Re: [SPAM] Re: How to create a self contained GTK+ Application for Linux

2007-05-23 Thread Michael L Torrie
On Wed, 2007-05-23 at 19:31 +0200, David Nečas (Yeti) wrote:
 And the dot is exactly what?  The current directory?

Yes

 Does the library know the directory it was loaded from?

It should, yes.  If it really does, I have no idea.

 Should libraries break when symlinked?

No.  Why would and should they?


One of the few advantages that GTK on windows has over linux is that the
entire GTK installation can be self-contained and moved around.
Everything is found relative to the dlls automagically.  Is this even
possible to do in Linux?


 
 Yeti
 
 --
 http://gwyddion.net/
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

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

Re: How to create a self contained GTK+ Application for Linux

2007-05-23 Thread Michael L Torrie
On Wed, 2007-05-23 at 23:07 +0200, David Nečas (Yeti) wrote:
 The current directory can be anything.  Particularly
 anything unrelated to the location to the components of the
 application.  Do you really think it's a good idea to make
 programs work or break depending on something so arbitrary
 as the current directory?

Typical unix pedantic response.  The current directory as defined by the
directory the gtk dlls are in, yes.  And yes it is a good idea.  (well,
except for the idea of env variables and LD_LIBRARY_PATH, which is a
better idea).

It works very, very well for the win32 GTK libraries.

 
 Yeti
 
 --
 http://gwyddion.net/
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

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

Re: How to create a self contained GTK+ Application for Linux

2007-05-23 Thread Michael L Torrie
On Wed, 2007-05-23 at 23:44 +0200, David Nečas (Yeti) wrote:
 The current [working] directory is what getwd() returns.
 At least that's what everyone else seems to mean by the
 current directory.

Well obviously getpwd is not good enough, then.  What would be needed is
the directory the .so file was loaded from, not the working directory.
That's what everyone is meaning here when they say ./blah in the
context of the linker.  Of course they don't mean the current executable
working directory.

 
  And yes it is a good idea.
 
 And it is ridiculous.

You're being difficult for the sake of being difficult.  I know you
understand what I am meaning about relative paths to the current
directory, meaning the directory from which the library was loaded,
symlink or no.

 
  It works very, very well for the win32 GTK libraries.
 
 Finding self is normally based on GetModuleHandleW()
 + GetModuleFileNameW() on Win32.  I asked how you do this on
 other systems.

That's my question too, and others'.  In fact, by talking about the ./
stuff that you're so caught on, that's exactly what we are asking. My
point was merely, Windows is ahead of us in this area, how can we
accomplish the same thing in a clean way?

 
 Moreover, Win32 has some habit of looking for libraries in
 the executable's directory, and that's both weird and the
 only reason why it works.

It's different, but not weird.  In fact, in the context of the rest of
Windows, it's very logical.

And I (and others) am saying, there has to be a better way on Linux and
Posix systems.  Hard-coded paths are clunky.  If GTK's .so files can
dynamically find their plugin components based on an environment
variable, that is ideal.  In fact, if someone could help the original
poster in this, that would be the solution to his problem (well, other
than ancient libc abi problems).  I think that various thread posters
have pretty much stated that this is the current, best way to go.  Are
there any docs on what env strings to set?


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

Re: How to create a self contained GTK+ Application for Linux

2007-05-23 Thread Michael L Torrie
On Wed, 2007-05-23 at 15:12 -0700, Daniel Yek wrote:
 (Sorry for being busy-body here...; and keep in mind that I might have not 
 read up the thread messages in details.)

No more than the rest of us. :)

 
 If it is to the executable path, it is easier -- by reading the symbolic 
 link target of:
/proc/pid/exe
 if the symbolic link exists.
 
 For DSOs, is it an option to get the module load address and parse:
/proc/pid/maps
 to find out the module load address, in the name of making bundled modules 
 work more reliably?

That is not portable at all.  AIX 4 has no /proc, and older unixes may
have /proc, but not the maps stuff.  Unless Posix has an API for doing
this (I don't believe it does), it's not a viable solution.

Really, the only issue here is having a way for GTK to find the loadable
modules and plugins and things.  The linker can find the libraries based
on LD_LIBRARY_PATH, and GTK, Pango, and others can (hopefully) be set to
check environment variables to find their modules and data files.
That's the most portable way to do this, the cleanest, and least
dependent on OS-specific behavior.


 
 

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


Re: Gtk+ and multithreating

2007-05-16 Thread Michael L Torrie
On Wed, 2007-05-16 at 23:22 +0100, Chris Vine wrote:
 
 And you would need to put the Hello argument on the heap, and free it
 in the wrapper function, because otherwise it will go out of scope
 before the idle handler is called. (Sigh).  Use g_strdup() to create the
 string on the heap.  Simple examples are never that simple.

On this case, Hello is a statically allocated string.  It's always
available and never is destroyed (it is always on the heap, as it were).
Not something that's typically useful, though.  In general, yes, data
must be allocated on the heap, not the stack, in order to be passed to a
callback handler like this.  Unless it's a global static object (such as
a string literal).

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

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


Re: serial ports

2007-05-14 Thread Michael L Torrie
On Mon, 2007-05-14 at 18:49 +, Pavel A. da Mek wrote:
 When I want to use serial ports, shall I write separate code for Windows and 
 for Linux, or is there some library function which would allow to do it in 
 the platform  independent way? 

There's definitely no GTK library calls to support this type of thing,
so you can either maintain separate code for win32 and linux (ifdefs or
something) or find a reliable, third-party library that fits your
technical and licensing requirements.

I have heard that doing any kind of serial port programming on Windows
is very very painful.  On Linux it's easy.


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

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


Re: Install GTK on windows using no official installers

2007-04-25 Thread Michael L Torrie
On Wed, 2007-04-25 at 08:02 -0700, David J. Andruczyk wrote:
 Beware that doing so (incorporating a private GTK+
 release intro your installer) will mostly likely BREAK
 or screw up ANY OTHER GTK+ apps on the box..

Nope it won't.

 
 I have this problem with my software (MegaTunix).  I
 recommend my users to use the gladewin32.sf.net GTK+
 runtime as it has GTK+, glade, and gtkglext, all in a
 simple 5 click installer.  
 
 Users report that if they had gaim installed,  this
 breaks things horribly.  They can't run my SW with
 gaim's GTK+ as it is missing gtkglext, and cairo
 dll.s, and instlaling the sladewin32.sf.net runtime
 doesn't resolve it as gaim's privatized gtk+ screws
 up the rest of the system except for itself.

You are not shipping a private version of GTK in the sense that Tor was
advocating.  You are shipping a global version of GTK.  No wonder it
clobbers Gaim (which, alas, also uses a global version of GTK).

 
 So adding in your own privatized version is likely to
 affect other applications.

No.  Shipping your own version of GTK within your program's directory
structure is completely safe.  GTK exploits the Windows default search
pattern for DLLS.  Windows first looks for a DLL in the same path as an
executable that's asking for it.  Thus you're directory structure will
look like this:

Program Files
 \--Your app
\--bin
   \--your exe, plus GTK dlls
\--lib
   \-- gtk dependencies such as image loaders
\--etc
   \-- gtk configuration files, theme rcs
\--share
   \-- more gtk stuff
etc

Your shortcut (lnk file) to the application that you write into Start
Menu specifies the full path to the binary, and says to start in the bin
folder (very important).  GTK dlls are all smart and will look for their
other dependencies relative to their own locations.  Thus this little
GTK app and libraries are completely self-contained.

 
 The best all in one runtime I have found for me is
 the gladewin32.sf.net as it keeps it's DLL's OUT of
 the window's dir (everything goes into C:\GTK)

All GTK runtimes I've ever seen keep stuff out of the windows system
dir.

 
 It also includes bits that other GTK+ libs DO NOT
 have,  like gtkglext (openGL extension),
 glade/libglade, libxml2, cairo, etc.

Cairo is a requirement for GTK.  In the self-contained tree that Tor
described, you put all these in the bin folder, along with your exe.

Michael


 
 
 --- Tor Lillqvist [EMAIL PROTECTED] wrote:
 
  Bleriot Trece writes:
is it possible to copy a set of GTK files (DLLs
  or whatever) and,
in this way, make GTK available WITHOUT using an
  official GTK
installer?
  
  Of course. And anyway, the degree of officialness of
  the various GTK
  installers out there isn't that clear.
  
what files should be copied, what environment
  variables
modified... and so on?
  
  I could try to list them, but you learn best by
  doing, so I will tell you
  how to do that:
  
  Start by fetching from
  http://ftp.gnome.org/pub/gnome/binaries/win32/
  the latest run-time zipfiles (not the *-dev-* ones)
  for gtk+, pango,
  atk, glib. From the depencensies subfolder get the
  latest cairo,
  gettext, and libiconv run-time zipfiles. If you know
  that your app
  will need the libpng pixbuf loader at run-time, also
  get libpng and
  zlib.
  
  Unzip all the above in some new empty folder. Add
  the bin folder of
  that to your PATH environment variable.
  
  Then start removing stuff you think your app and
  your customers won't
  need. For instance, if you don't have any need for
  localised strings from
  gtk+ etc, you can remove everything from lib/locale
  . If you want localised
  strings, but not for some exotic languages, remove
  the corresponding
  subfolders from lib/locale.
  
  If you don't need pixbuf loaders for exotic image
  formats, remove
  those dlls from lib/gtk-2.0/2.10.0/loaders .
  
  If you don't need gtk+ input modules, drop
  lib/gtk-2.0/2.10.0/immodules
  . Also, then edit etc/gtk-2.0/gtk.immodules.
  
  If you want the MS-Windows theme to be the default,
  create a file
  etc/gtk-2.0/gtkrc with the line gtk-theme-name =
  MS-Windows . Otherwise,
  if you don't want the end-users to be able to change
  theme engine, drop
  lib/gtk-2.0/2.10.0/engines and
  share/themes/MS-Windows .
  
  If you don't need the Freetype2 Pango backend (and
  you presumably
  won't), remove bin/linpangoft2-1.0-0.dll.
  
  Hmm, that should be about it. If I forgot something
  obvious that can
  also be dropped, please follow-up...
  
  Then you add what's left to your application's
  installer. 
  
  Don't change the folder substructure. Keep the DLLs
  in the bin
  subfolder for instance.
  
  It's easiest to put your application's exe file in
  the same bin folder
  and have your Start Menu etc shortcuts point to
  that. Otherwise you will
  have to make sure that the bin folder is included
  in PATH when the
  end-user runs your app, either by having your
  installer 

Re: Install GTK on windows using no official installers

2007-04-25 Thread Michael L Torrie
On Wed, 2007-04-25 at 18:23 +0200, Hans Oesterholt-Dijkema wrote:
 That's not acceptable for  my situation. I'm using a Gtk+ binding
 for PLT Scheme.

You can't statically link GTK on windows anyway.

 
 --Hans
 
 
 David J. Andruczyk schreef:
  statically link your program so that is doesn't need
  any outside libs. (it'll likely be large in size and
  won't respond to theme changes (may not matter to
  you))
 
  there are other caveats to that AFAIK.


___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: is glib too bloated?

2007-04-23 Thread Michael L Torrie
On Mon, 2007-04-23 at 10:05 -0400, Tristan Van Berkom wrote:
 It might be advantagous if alot of the glib data structures
 were moved somewhere above libgobject in the stack (glibutils ?),
 this way they could have the option of being gobject based,
 opening a whole new world of possible code paths and also allowing
 more generic access to these data structures through the gobject
 api (hash tables and linked lists could possibly be serialized
 by libglade and crammed through a network socket ? for an example of
 a misc wild idea).

I think you mean below the gobject stack, don't you?  The data
structure libraries are required by gobject after all, aren't they?

In any case, I think a future split out of the glib data structure api
would be excellent.  I pretty much use thinks like gslist, gstring, and
ghash in *all* my C programs.  I also frequently use the glib logging
facility.  

On the other hand I don't often use gobjects, the event loop,
call-backs, or any other part of glib in many of these little utility
programs.  

It would be nice, though, to only have a small dependency, rather than
the entire glib.

That said, glib isn't that big.

 
 The biggest advantage to this, and everyone will disagree here/, 
 is that it would require breaking api in the platform - which is a 
 thing the platform is in dire need of (how is all the needed
 refactoring going to get done if we cant drop support for all the older
 widgets and older deprecated functionalities ?), in the end this is why
 something like this reorganization of the stack will never happen until
 affirmative action is taken and a dream like gtk+-3.0 is realized.
 
 /me dreams on just for the sake of dreaming :)
 
 Cheers,
  -Tristan
 
 
 ___
 gtk-devel-list mailing list
 gtk-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-devel-list
 

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


Re: Compile warning (newbie)

2007-04-17 Thread Michael L Torrie
On Mon, 2007-04-16 at 23:09 -0700, William D. Tallman wrote:
 Then it should be like this?
 
 void edit_changed (GtkWidget *widget, gpointer *data)
 {
 const gchar *str;
 gchar *strcopy;
 
 str = gtk_entry_get_text (GTK_ENTRY (widget));
 
 strcopy = g_strdup(str);
 
 g_print (Entry changed to %s\n, strcopy);
 
 free(strcopy);
 }
 

In your case, you don't need to strdup since you're not modifying the
string.  You only need to strdup if you need to manipulate a copy of the
string in some way.  For example,

strcopy=g_strdup(gtk_entry_get_text( GTK_ENTRY( widget )));
g_strcat(strcopy, random text added for my purposes);
//do something with strcopy
g_free(strcopy);


 I'm no whiz with C itself and have never used strdup.  IIUC, the
 template is as above, replacing the g_print with whatever is to be done
 with the copied string.  Is that correct?  If not, what don't I
 understand here?

I use strdup all the time, for the specific cases where I need to
manipulate a string that is being returned to me from a function.  See I
don't own the memory that I'm being given a pointer to.  Thus I can't
modify that memory directly (say to make it all lowercase or append text
to it).  I have to make my own copy.  

Note that many of the glib string utility functions already have a
built-in strdup.  For example, g_ascii_tolower() returns a duplicated
string that is all lowercase, which you will have to free later.

Generally speaking, if a function returns a const char * (or gchar),
that means you are getting a pointer to a string buffer that you should
not modify.  If you need to modify that string buffer, make a copy of it
first.

Michael



 
 Thanks,
 
 Bill Tallman
 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Compile warning (newbie)

2007-04-16 Thread Michael L Torrie
On Tue, 2007-04-17 at 08:22 +1000, Andrew Cowie wrote:
 Return type of gtk_entry_get_text() is (const gchar*), not just
 (gchar*). You discarded the const qualifier when assigning the result to
 str.
 
 Just declare str with const.

The reason why this is important is because gtk_entry_get_text is
returning you just a pointer to a buffer inside the widget.  Therefore
you should never modify it.  If you do, you run the risk of crashing the
program.  That's why the return type is const and the compiler gives you
a warning.

If you want to do something to the string you need to copy it with
g_strdup, remembering to free your copy when you are done.

Michael


 
 AfC
 Sydney
 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: GTK - I always get a corrupted file!

2007-04-11 Thread Michael L Torrie
On Thu, 2007-04-05 at 20:44 +, Jamiil Abduqadir wrote:
 I have repeatedly down loaded gtk+-2.10.9.tar.bz2 from 
 ftp://ftp.gtk.org/pub/gtk/v2.10/, but I always get a
 currupted file, what is going on? I didn't have any problems with the
 other files!
 Is is an isolated problem?
 if not, where else can I down the file?
It's a problem on your end.  The file is not corrupt on the server.  I
can download and uncompress it fine.  

Once the file is downloaded, what does the linux file command say
about it?  Sometimes browsers will automatically unzip the file on
download, without telling you, leaving you with an uncompressed
tarball. 

When you download the file, tar -xjf gtk+-2.10.9.tar.bz2 gives you an
error?  What about the other dependencies, like glib?

 
 Thanks folks! 
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: How to get pixel values along a line?

2007-04-10 Thread Michael L Torrie
On Tue, 2007-04-10 at 15:02 +0200, Fredrik Persson wrote:
 I writing a gtk application where I need to do the following; let the
 user mark two pixels in a drawingarea (as you would if you were to
 draw a line in, for example, the gimp) and then, somehow, have the
 pixel values along that line be returned to me in some form. The goal
 is to present a graph to the user with those pixel values. 
 
 The problem at hand is; how do I get those pixel values?
 
 (And I'm writing this in pyhon, so if someone wants to provide code
 examples in python, that would be great.)

The only way to get information back from a GtkDrawingArea is in a
really round-about, slow way.  It would involve round-trip calls to the
server as the GtkDrawingArea's Gdk window lives on the X-server.  To get
pixel values would require one server call (and network transmission)
for each pixel you want to query.  This is very very slow.

The best way to do what you are trying to do is to have a GdkPixbuf
backing store that your program draws to, which is rendered to the
GtkDrawingArea on expose or configure, or update.  Since the GdkPixbuf
is local (not server), you can easily query it's RGB data directly.  You
likely already have a Pixbuf (or some other object) to be a backing
store for the GtkDrawingArea, as you'd need to account for redraws
anyway.  Anyway, I think this is the direction you probably need to go.

Michael


 
 TIA!
 
 /Fredrik Persson 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: File dialog tab completion question

2007-04-10 Thread Michael L Torrie
On Tue, 2007-04-10 at 14:51 -0700, Jeff Gustafson wrote:
   Is there a way to cause the tab completion on a directory to update the
 file selection box?  I think this used to be the behavior.  Now, no
 matter how much I press tab the file box will not update.  

Sadly this behavior was replaced with the intelligent search and the
type-head stuff in the entry box.  

It is not possible to put this feature back in without breaking the API.
I am very torn as I think this was the single-most useful feature of the
original dialog.  On the other hand I don't see how this feature can be
fit into the new dialog box without breaking it's behavior in several
ways.  Not to mention UI guidelines.

   Here is the situation:
 
   o File-Open
   o Start typing full path
   o Tab to complete some of the names.
   o I want the file area to update now so that I can select multiple
 files.  
 
   Using 'gtkpod' I have to click (or Alt-O) to get the directory I want
 'opened' so I can see all the files I want to import.
   Is there a hidden toggle that I can set to restore this capability?



 
   ...Jeff
 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Desesperated: I need that my server draws

2007-04-05 Thread Michael L Torrie
On Thu, 2007-04-05 at 08:43 -0700, nahuel9728 wrote:
 First of all: Hello everyone. I'm developing a tool for cluster.
 I have a server that receive a lot of datas.
 Everytime that the server receive a data, I need that draws in a pixmap. I
 have all the estructure and I know how to draw in a pixmap. But I dont know
 how to make the server draws the interface. Any idea?? Anyone did something
 similar...??
 I'm a little bit desesperated...?? :-(

You basically need to use g_io_channels to have the GTK (Glib) main loop
watch the socket for data and then process it in a callback.
Alternatively, look at the gnet library (dr. google can find it for
you).

 
 Eyy!! Really good forum.

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


Re: Can I implement such a function with gtk?

2007-04-05 Thread Michael L Torrie
On Fri, 2007-04-06 at 01:01 +0800, Kun Niu wrote:
 Dear all,
 
 I found that there's a function called gtk_window_iconify.
 I tried to add it to my delete_event function.
 It worked well for me.
 But I have a request that after delete_event is triggered. The minimized
 window should disppear from my system toolbar(for example, at the bottom of
 the screen on Windows and at the top of the screen on Gnome at present
 release) and appear as a status icon.
 
 Can I find such an example?

http://marcin.af.gliwice.pl/if-then-else-20070121143245 -- this gives
examples in python, but it uses standard gtk api (introduced in GTK
2.10).  If you want to support older versions of GTK, take a look at the
tray stuff in libegg

Michael



 
 Thanks in advance and look forward to your reply.
 
 Sincerely,
 Kun
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

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


Re: Drawing two filled rectangles with colors

2007-04-05 Thread Michael L Torrie
On Thu, 2007-04-05 at 11:31 -0300, [EMAIL PROTECTED] wrote:
 Hi.
 
 I am having difficulties writing a simple demo program that draws two
 filled rectangles with different colors in a drawing area. More
 precisely, I am not sure how to deal with the colors. Maybe someone
 would write the demo and post it here.

If you check with the gtk-demo example program that ships with GTK,
you'll find a GtkDrawingArea demo, complete with source code.  It
illustrates (in the checkerboard_expose() function) how to create GtkGC
objects that set the color, which you then use in the drawing functions.
You'll also want to look up the documentation on the GtkGC class, as the
GC objects contain other attributes like pen style, fill colors, etc.

 
 Regards,
 
 JoséRomildo
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Any automated interface / GUI Testing tool for GTK ?

2007-04-03 Thread Michael L Torrie
On Wed, 2007-04-04 at 02:36 +0530, rush ta wrote:
 Thnx for the reply Michael...
 I am looking for GUI testing ...
 programmatically pressing button in a GUI on the screen !

Please keep your posts on the list.  Mainly because others can see it
and give their input.  I myself know of no such tool offhand.  I believe
you can accomplish some of this using the XTEST X server extension, but
it sounds like  complicated stuff.

Personally I don't see how automated testing of a GUI does anything
useful, other than proving the GUI toolkit works, which is not quite
what you're looking for.  I would think that code coverage tests and
unit tests would be of far greater value.  Also such testing promotes
good design.  Business logic should never be mixed in with GUI display
code.  Of course it's always possible to forget to connect a GUI signal
and thus have a button that's not working.

Anyway, perhaps someone else who has knowledge in this area can comment.

 
 On 4/3/07, Michael L Torrie [EMAIL PROTECTED] wrote:
 On Tue, 2007-04-03 at 16:29 +0530, rush ta wrote: 
  Hello,
 
  I was wondering if there is any tool for automated
 interface/GUI testing
  tool for GTK ?
 
 Are you speaking of unit-testing, or a way of driving the gui
 (programmatically pressing buttons in a gui on the screen from
 another 
 program) or what?
 
 
  Thanking in advance
 
  Regards
  Rush
  ___
  gtk-app-devel-list mailing list
  gtk-app-devel-list@gnome.org
  http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 
 
 ___ 
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

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


Re: Any automated interface / GUI Testing tool for GTK ?

2007-04-03 Thread Michael L Torrie
On Tue, 2007-04-03 at 16:14 -0600, Michael L Torrie wrote:
 On Wed, 2007-04-04 at 02:36 +0530, rush ta wrote:
  Thnx for the reply Michael...
  I am looking for GUI testing ...
  programmatically pressing button in a GUI on the screen !

Actually, here is something that may get you started:

http://search.cpan.org/~ctrondlp/X11-GUITest-0.21/GUITest.pm

 
 Please keep your posts on the list.  Mainly because others can see it
 and give their input.  I myself know of no such tool offhand.  I believe
 you can accomplish some of this using the XTEST X server extension, but
 it sounds like  complicated stuff.
 
 Personally I don't see how automated testing of a GUI does anything
 useful, other than proving the GUI toolkit works, which is not quite
 what you're looking for.  I would think that code coverage tests and
 unit tests would be of far greater value.  Also such testing promotes
 good design.  Business logic should never be mixed in with GUI display
 code.  Of course it's always possible to forget to connect a GUI signal
 and thus have a button that's not working.
 
 Anyway, perhaps someone else who has knowledge in this area can comment.


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


Re: Problem with GUI not (always) updating...

2007-04-02 Thread Michael L Torrie
On Mon, 2007-04-02 at 13:58 +0200, Matthias Scheer wrote:
 Hi all,
 
 I'm developing a computational tool with a nice GUI using GTK2+ and 
 Glade3. The OS is Ubuntu 6.10 with Gnome UI. Now I have encountered some 
 strange behaviour.
 
 The application essentially asks for alot of parameters for the user to 
 enter, has a progress bar and a start, pause and exit button. When the 
 users hits start, I'm spawning a new thread (using pthreads) and let the 
 signal handler of start button return to the gtk_main() loop. This is 
 required because the computation takes quite some time and the user 
 should have the possibility to pause the program.
 
 Now I've run into some 'indeterministic' effects. In about half of the 
 test runs, the GUI keeps accessible to the user, i.e. eyecandy on the 
 button on mouse-over, and the program works normally. In the other half, 
 the GUI freezes, but the computation finishes normally. Strangely, the 
 program reacts on clicks on the GUI, i.e. it pauses, exits etc, but the 
 GUI itself is frozen.

This is classic behavior when you use threads in GTK without following
the instructions for using GTK in a threaded way. 

Does your thread interact with the gui at all?  Are you following the
documentation for setting up GDK threading and locking any calls to gtk
from your thread?  If you are calling gtk calls from your thread for the
purpose of updating the gui, consider calling the thread-safe g_idle_add
call from your thread and then having a callback (which would run in the
main GUI thread) do any gui calls for you.

Michael

 
 I'm running kernel 2.6.20.3 with the xenomai real-time patch.
 
 Any hints?
 
 Matthias Scheer
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: (severe) performance issues

2007-04-02 Thread Michael L Torrie
On Mon, 2007-04-02 at 08:56 -0700, David J. Andruczyk wrote:
 I did further testing . Packing the label with EXPAND
 flags has ZERO change, as does restricting its size
 with a set_usize.  It still causes high cpu usage.
 
 I've expended enough effort on this thorn in my side,
 and have relegated to using GTK entries instead. (they
 look crappy (the box/border makes things too busy
 compared to the clean label), as I didn't want to have
 to go thru the trouble of drawing a  layout and having
 to worry about configure/expose events with manual
 drawing.

Did you ever try the suggestion of putting the label in a GtkFixed
container?  Seems like that would be the best workaround for you.
GtkFixed will only experience the configure event (and subsequent
cascade of adjustments) when it is first displayed.  After that you can
update the label to your heart's content without setting of a cascade of
configure events.





___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Problem with GUI not (always) updating...

2007-04-02 Thread Michael L Torrie
On Mon, 2007-04-02 at 19:35 +0200, Matthias Scheer wrote:
 Michael L Torrie schrieb:
  This is classic behavior when you use threads in GTK without following
  the instructions for using GTK in a threaded way. 
  
  Does your thread interact with the gui at all?  Are you following the
  documentation for setting up GDK threading and locking any calls to gtk
  from your thread?  If you are calling gtk calls from your thread for the
  purpose of updating the gui, consider calling the thread-safe g_idle_add
  call from your thread and then having a callback (which would run in the
  main GUI thread) do any gui calls for you.
 
 Actually, I am only updating the GUI right before I send the worker 
 threads to sleep, mainly to save CPU time for the computation. I've been 
 trying to fix this behavior with a pthread mutex that locks on GUI 
 access but after reading the FAQ I think this only made it worse.

No need to use pthread mutexes for this particular thing.  The Gtk
threading apis already provides general lock calls to protect stuff.
You need to initialize threading in GTK (GDK actually) and then surround
gtk or gdk calls with the _enter and _leave calls.  See:

http://www.gtk.org/faq/#AEN482

the g_idle_add method is the more portable, and easier to work-with
solution in many cases.  Since you are using threads, you still will
want to initialize the threading system with a call to g_thread_init and
gdk_threads_init.

 
 Thanks for the heads-up and sorry for asking FAQ-material.

no worries.  

 
 Matthias Scheer
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: (severe) performance issues

2007-03-29 Thread Michael L Torrie
On Thu, 2007-03-29 at 09:24 -0700, David J. Andruczyk wrote:
 Though when a widget implementation causes 5-10x more cpu usage due
 to a bad design. I think it warrants attention.

Of course the speed of it can and should be improved across the board.
But to say that it is bad design is not correct.  It is no more poor
design than any other widget.  Except for the corner cases where
GtkLabel is not appropriate (such as in your case), the setup time is
only incurred once, just like any other widget.  To hack in logic to
deal with your corner case would likely lead to even poorer design.

 
 Add one simple function call to assign a label a FIXED size
 (similar to the call for GtkEntries) so as to prevent the resize up
 the widget tree syndrome.  When a label update occurs, either
 truncate anything past that limit,  or if the ellipses property is
 set to use that instead to show the label is larger than it's
 allocated area.

I don't think it is that simple.  First of all, a fixed size that you
think is right for your app may or may not even have enough room to
display any of the text of the label on other people's systems.  They
may not be using the same font for the default in GTK, not the same DPI,
etc.  Thus how would you specify fixed?  Further a GtkLabel can
contain markup and cover multiple lines and have different kinds of
alignment and justification.  

 
 It would solve the cpu usage problem from the resize triggers and
 not break backwards compat.  It's also something that should have
 been done 3-5 years ago.

It would break binary compatibility.  Your best bet is to follow the
lead of evolution and other projects that need similar functionality and
implement a custom widget, and perhaps submit it to the GTK head
developers as an ancillary widget.

Michael

 gtk-list@gnome.org

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: (severe) performance issues

2007-03-29 Thread Michael L Torrie
On Thu, 2007-03-29 at 10:48 -0700, David J. Andruczyk wrote:
 --- Michael Ekstrand [EMAIL PROTECTED] wrote:
 
  On Thu, 2007-03-29 at 09:24 -0700, David J. Andruczyk wrote:
   Though when a widget implementation causes 5-10x more cpu usage
  due
   to a bad design. I think it warrants attention.
  
   [suggested fix snipped]
  
   It would solve the cpu usage problem from the resize triggers
  and
   not break backwards compat.  It's also something that should
  have
   been done 3-5 years ago.
  
  It's open-source software.  If this issue is that important to
  you,
  submit a patch.  Criticizing the volunteers working on GTK+, who
  evidently haven't found this to be a significant enough issue to
  warrant
  this kind of attention, isn't a constructive way to promote
  change.
  
 
 I did my part by SUBMITTING BUG REPORTS, several in fact..
 I'm an not a GTK+ wizard, nor do I know all the intricacies about
 how it renders.  hence I GAVE them the information ,described the
 problems, and it was tossed out.

I am not a GTK developer; I'm more of a list lurker.  But I do use GTK
for developing and I am familiar internal GTK code.  So I merely give my
opinion.  The reasons for this being marked as won't fix have been, in
my opinion, fairly clearly expressed on the list.  Unless you can a)
argue persuasively why changing this behavior (the so-called bug) is
worthwhile to the majority of GTK users, preserves the ABI, does not
introduce new behaviors or side effects or b) demonstrate code that does
these things, then you need to accept the opinions of the developers and
move on with your own work-around code.  Complaining here will not bring
about any progress on this issue.  I believe I can summarize the reasons
why GTK developers have dismissed your bug report:

- The bad behavior is only apparent in a corner use case of GtkLabel
that was never an intended use.  GtkLabels were never designed for
constant updating.  The nominal use case is a on-time setup, incurring
no more cost than any other widget setup.  Other uses likely need to be
fulfilled by another built-in widget or custom widget.
- Changing the code to fix this behavioral problem would break the
binary compatibility and likely introduce new bugs and side-effects.  A
new API for GtkLabel should be introduced to the GTK3 work, not GTK2.
Despite what you say, your changes would indeed introduce a new API and
break GTK2.x compatibility (ABI).
- The cost in developer time of changing this behavior is simply too
high.  Since it does not affect the speed and stability of 99% of GTK
apps, developer time should be spent elsewhere.

Another minor issue may have been the way you wrote up the bug report.
Bug reports that give the impression that the GTK developers owe you
something will likely not elicit a favorable response, especially given
the points above.  If it was similar to your posts on this issue, then I
can imagine that the human factor may have played a role.

In short, I think GTK developers have agreed with you that this behavior
of the GtkLabel during updates can cause issues, but given the points I
mentioned, will not fix this corner case for you in the stable GTK2
branches.  However they have suggested some very good workarounds,
including writing/borrowing your own GtkLabel widget that would work
better for your use case.  In fact they even told you where to go to see
exactly such code.

cheers,
Michael


 
 
 
 -- David J. Andruczyk
 
 
  


___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Save Dialog

2007-03-29 Thread Michael L Torrie
On Wed, 2007-03-28 at 13:34 -0400, Docsonic wrote:
 I use Inkscape and posted a request on their list, they referred me to
 your list as the save dialog they use is GTK. So, I wanted to know if it
 was possible to change the save dialog so that, when you create a new
 subfolder, you are automaically entered into that folder. i.e. If I
 create a subfolder and name it 'New', once I enter to accept the new
 name the directory structure places me into the 'New' folder to name and
 save the document.

Interesting proposition.  I wonder if this would lead to user confusion.
Except for the crumb bar, there is little indication that the create
folder operation was successful if a user is automatically moved to the
new folder.  My grandmother would likely end up creating dozens of
nested folders without realizing it.  Another thing is that given the
way GTK's save dialog box currently implements the new folder
mechanism, the folder goes into the file list immediately but sticks it
in edit mode so the user can give it a name.  This behavior is not
possible if the save dialog box works as you suggest.

Just some observations.

Michael


 
 Thanks,
 
 Tony
 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Sudden Tango changes in trunk

2007-03-28 Thread Michael L Torrie
On Wed, 2007-03-28 at 11:33 -0500, Yevgen Muntyan wrote:
 Um, we can do that only if we have the icon. And that's a
 problem. If someone volunteers to draw missing icons for
 me then I'll be glad, but until then I will use gtk-about for
 bookmarks and gtk-select-font for Configure Shortcuts
 thing.

I'd kindly suggest that one alternative is to borrow icons from other
applications when the license makes it possible. For example, there is a
nice Add bookmark icon used in Galeon and Epiphay.  I'm sure there is
another icon out there somewhere that would be good for configure
shortcuts.



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


Re: Sudden Tango changes in trunk

2007-03-28 Thread Michael L Torrie
On Wed, 2007-03-28 at 20:00 +0100, Alex Jones wrote:
  This wouldn't work too well. MS Windows just doesn't have much of an
  icon style to begin with. Microsoft seem to rework their icons for
  each new Windows release, causing a lot of visual disparity among all
  the applications targeted towards the platform. In short, creating
  special MS-Windows icon theme wouldn't do much good. 
 
 Microsoft have pretty decent style guidelines for every release...
 better than GNOME's and Gtk's!

+1 funny.

Seems like MS Office becomes the de facto style guide usually.  Witness
Office 2007, (for which the UI was beta-tested in IE 7) which defined
the vista UI.

  
  
  regards,
  
  Vincent
  
  ___
  gtk-devel-list mailing list
  gtk-devel-list@gnome.org
  http://mail.gnome.org/mailman/listinfo/gtk-devel-list

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


Re: Smooth Scrolling

2007-03-27 Thread Michael L Torrie
On Tue, 2007-03-27 at 15:54 +0200, Xavier Bestel wrote:
 On Tue, 2007-03-27 at 07:37 +0100, Alex Jones wrote:
  A few years ago there used to be a distributor patch in Gentoo to enable
  this, and it was sweet. What happened, here?
 
 I dunno, but it's more than sweet. Whoever remember the text editor
 CygnusED, which had a very smooth scrolling, vblank-synchronized,
 progressive, knows that this helps wonderfully to know where you are
 once you have scrolled. Currently in GTK+, after hitting the scrollbar
 you have to think for a moment to let your eyes find the cursor again.
 
 To me, smooth scrolling is the same improvement than compiz/beryl is wrt
 virtual desk switching. Except it was already implemented on low-end
 hardware 15 years before :)

Smooth scrolling is only good if it is very fast (as fast as without
smooth scrolling) and totally synchronized with both the redraw and the
mouse wheel's speed, in order to eliminate tearing and stuttering.  I
think we're finally to the point where it could be done right.

IE 5,  if I recall correctly, had smooth scrolling and it was the first
thing most I turned off because it was so annoying.  It had a constant
lag and, because of the scroll steps (ie one click of the scroll wheel
is so many lines) it would hesitate and appear to stutter.  Half the
time it would have to catch up to you.  Was awful. 

I think the fundamental problem is that the mouse scroll wheel is really
a low-resolution input device, with discreet jumps that have to be
mapped to pixels or lines somehow.  Whether or not smooth scrolling is
actually smooth depends entirely on how it can react to various scroll
wheel speeds.  Slowly moving the scroll wheel, for example, causes the
scroll bar to jump in discreet jumps, and smooth scrolling amplifies
that motion and makes it jumpy (well it's jumpy without smooth-scroll
too), from my experience.  Fast scrolling is where smooth scrolling
looks the best, so long as it doesn't lag behind where the user expects
to be.  If the scroll wheel was ultra-high resolution, then it would
always work well.  But most scroll wheels are not high-resolution
(except for may Apple's mighty mouse).

 
   Xav
 
 
 ___
 gtk-devel-list mailing list
 gtk-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-devel-list
 

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


Re: Smooth Scrolling

2007-03-27 Thread Michael L Torrie
On Tue, 2007-03-27 at 21:38 +0200, Xavier Bestel wrote:
 After playing with Gedit a bit I think GTK+ isn't up to the task of
 scrolling fast enough to achieve that.

I disagree.  All you have to do is drag the scroll bar to see exactly
how fast and smooth, pixel-per-pixel scrolling can be.

 
   Xav
 
 
 ___
 gtk-devel-list mailing list
 gtk-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-devel-list
 

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


Re: use of g_thread_exit

2007-03-26 Thread Michael L Torrie
On Mon, 2007-03-26 at 10:21 +0530, Pritesh Kumar wrote:
 high all,
 in a video player application , i create a thread using g_thread_create() .
 upon meeting some condition , i exit the thread using g_thread_exit(NULL).
 NOW  i want to perform a operation in int main() function of my
 application only if the above mentioned thread has exited successfully.
 is there a way to do this. how can the int main know if the created thread
 has exited or not.

I believe this is what the g_thread_join api call is for.  I think,
however, that it is a blocking call.  You'll want to read all the docs
the g_thread calls in the API docs.

 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: use of g_thread_exit

2007-03-26 Thread Michael L Torrie
On Mon, 2007-03-26 at 13:37 +, [EMAIL PROTECTED] wrote:
 On 3/26/07, Pritesh Kumar [EMAIL PROTECTED] wrote:
  NOW  i want to perform a operation in int main() function of my
  application only if the above mentioned thread has exited successfully.
  is there a way to do this. how can the int main know if the created thread
  has exited or not.
 
 g_thread_join()?
 
 http://developer.gnome.org/doc/API/2.0/glib/glib-Threads.html#g-thread-join
 
 This will block if the thread has not exited yet. You'll need to send
 a I'm about to exit, please call g_thread_join() message from the
 worker.

An easy way to do this may be to use g_idle_add() do this notification
to the main thread.

 
 John
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: (severe) performance issues

2007-03-26 Thread Michael L Torrie
On Mon, 2007-03-26 at 11:27 -0700, David J. Andruczyk wrote:
 I changed from gtk_labels to gtk_entries instead and cpu usage
 drops to near zero now.  Took me a while to figure out how the hell
 to get the entry's background to change so that it essentially
 disappeared (and displays looking exactly like a label).
 
 so as of now my problem is solved by a hack around a problem INSIDE
 of GTK+.
 
 It doesn't render quite right in WinXP however. (and I suspect it
 may do that in various GTK+ themes), but my users can live with it
 now, as they can at least run it without it bringing their systems
 to their knees).

Hmm.  Maybe this performance issue is a windows-only thing.  Before you
post here, I had read your posts but not realized this was on Windows.  

 
 


___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Getting GTK+ to work on the Mac

2007-03-21 Thread Michael L Torrie
On Wed, 2007-03-21 at 14:22 +0100, Jeremiah Foster wrote:
 Hello,
 
 I am writing an article for the O'Reilly Network on getting GTK+
 to work on Apple's OS X operating system. I am familiar with a number
 of resources, for example Imendio's web site and build script, and 
 the pdf by Anders Carlsson which I am reading now. 
 
 I have not been able to get GTK+ to build on my OS X 10.3.9 machine
 with a PowerPC processor. I have posted to Imendio's hosted forum but there
 currently appears to be a lack of developers using the forum, or at 
 least they are not currently active.

Imendio's branch does not support 10.3 at all.  You have to have 10.4 to
build it.  I hope this will change, but they can only devote resources
to 10.4 at this time, unless some influx of volunteer developers occurs.
I would dearly love to see GTK Quartz on 10.3, and would spend time on
it if I could, but like everyone else, my time is limited.

 
 I would like to know if there are other resources on GTK+ and the Mac
 that I do not know about. 

MacPorts and Fink both have GTK+ for 10.3 or newer, but require X11.

Something else you might want to talk about in your article is methods
for deploying a GTK app in OS X.  For example, Gimp is available as a
Mac app bundle.  It requires X11 still, but the app bundle launches it
for you and also allows the gimp.app icon to receive file files via a
drag and drop in the finder or on the doc, and associates Gimp with file
types.  This makes Gimp, even though it's still running under X11 in
this case, more of a normal mac app.  

 
 Also is this the right forum for me to post issues regarding building 
 GTK+ on the Mac?
 
 Thanks very much,
 
   Jeremiah
 ___
 gtk-devel-list mailing list
 gtk-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-devel-list
 

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


Re: How do I get the GTK+ exec. file to Install?

2007-03-15 Thread Michael L Torrie
On Thu, 2007-03-15 at 05:09 +, Kayode Arowolo wrote:
 Dear gtk-app-devel-list,
 
 I have been trying to download the GTK+ exec files from www.gtk.org (ftp) so 
 that I can install on my system but all to no avail. Please help out with 
 suggestions on what to do.

I do not understand.  What are you trying to do?  Are you trying to
install pre-compiled GTK libraries on your operating system?  If so,
what operating system are you using?  Are you trying to compile GTK from
source?  You will need to provide more information and ask a specific
question.

 
 Thanks.
 Kayode Arowolo
   Computer Science Dept.
 University of the Witwatersrand
 Johannesburg. 
 
 
   
 -
  New Yahoo! Mail is the ultimate force in competitive emailing. Find out more 
 at the Yahoo! Mail Championships. Plus: play games and win prizes.
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

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


Re: How do I get the GTK+ exec. file to Install?

2007-03-15 Thread Michael L Torrie
On Thu, 2007-03-15 at 19:15 +, Kayode Arowolo wrote:
 Dear Michael,
 Dear Michael,
  
 Thanks for your response and concern. I need to develop the GUI for my
 project written in C. I want to install gtk on my laptop which runs on
 windows platform. Any suggestions will be appreciated.

Let's keep these e-mails on the list, please.

If you are using a tool like Dev-C++[1], there are pre-build packages
for that IDE that are quite nice.  See
http://www.bloodshed.net/dev/packages/gtk.html .

For use with Visual Studio, you just need to unpack the binary tarballs
somewhere (say to a folder called c:\GTK) and then in your project you
have to add all the libraries and add the include folder to your
includes path.  You can get these canonical binary tarballs from  
http://www.gimp.org/~tml/gimp/win32/downloads.html . There are also some
basic instructions on using them.  You will need to download all of the
dependencies on this page.  GTK depends on a lot of utility libraries
that don't ship with Visual Studio or windows.

When it comes time to deploy your application, you will need to make
sure that either your end users have the GTK runtime installed (there
are a number of installers out there to ease this for users; see
http://gaim.sf.net/win32) or you can bundle the GTK dlls in the
appropriate folder structure in the folder where you app installs.  GTK
cannot and should not be statically linked.

Michael




 Thanks.
  
 Kayode
 
 Michael L Torrie [EMAIL PROTECTED] wrote:
 On Thu, 2007-03-15 at 05:09 +, Kayode Arowolo wrote:
  Dear gtk-app-devel-list,
  
  I have been trying to download the GTK+ exec files from
 www.gtk.org (ftp) so that I can install on my system but all
 to no avail. Please help out with suggestions on what to do.
 
 I do not understand. What are you trying to do? Are you trying
 to
 install pre-compiled GTK libraries on your operating system?
 If so,
 what operating system are you using? Are you trying to compile
 GTK from
 source? You will need to provide more information and ask a
 specific
 question.
 
  
  Thanks.
  Kayode Arowolo
  Computer Science Dept.
  University of the Witwatersrand
  Johannesburg. 
  
  
  
  -
  New Yahoo! Mail is the ultimate force in competitive
 emailing. Find out more at the Yahoo! Mail Championships.
 Plus: play games and win prizes.
  ___
  gtk-app-devel-list mailing list
  gtk-app-devel-list@gnome.org
  http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
  
 
 
 
 
 
 __
 New Yahoo! Mail is the ultimate force in competitive emailing. Find
 out more at the Yahoo! Mail Championships. Plus: play games and win
 prizes.

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


Re: GTK on Mac OS X 10.4

2007-03-12 Thread Michael L Torrie
On Sun, 2007-03-11 at 19:24 -0400, Jim Canning wrote:
 I have a PowerBook G4 running Mac OS X 10.4.8.
 
 I have installed Mac's development environment Xcode Tools.
 
 What would I need to do to get GTK+2.0 built? Can I simply follow
 the install for UNIX like systems and then I am good to go?

http://developer.imendio.com/projects/gtk-macosx

Michael


 Jim
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: libglade frustration redux

2007-02-15 Thread Michael L Torrie
On Thu, 2007-02-15 at 13:46 -0500, Gerald I. Evenden wrote:
 A the originator of this thread I will rephrase my problems and make a larger 
 scale complaint.
 
 1. My original complaint was compile/linking glade output.  Thanks to M. 
 Torrie this problem was nicely solved and I can compile/link several examples 
 from various sources.

In the future, please be specific as to what compiler options you have
tried and what error messages were given to you.

 
 2. A side thread suggested that in order to understand the usage of a system 
 like libglade one should study the source.  Hmmm.  To use the C (or any 
 compiler) I should study the source code for the compiler???  To use the math 
 library I should study the library's source??  I did mess with the mathlib 
 source many years ago when the function 'hypot' was poorly implemented but I 
 have not done such a thing since.  And read the C compiler code for 
 understanding of how to use C---you have to be kidding.
 
 3. Getting back to libglade.  I have searched through many pages of google to 
 find either a decent reference and/or tutorial for libglade.  A couple of 
 tutorials make halfway attempts but ultimately fail because they have no 
 reference manual to rely on---among other failings.  Finding a libglade 
 reference manual is a total failure.  There are a couple of sites which claim 
 to be a reference manual but I find them totally inadequate.  There is NO 
 reference manual for libglade that can compared to what is available for GTK. 
  
 Even the GTK reference is questionable as I find reference to GTK functions 
 that are not in the GTK index nor locatable in sections dealing with the 
 widget involved.

In fairness, the API reference for libglade is complete and fine.  It's
only three calls.  Easy to use.  There are a plethora of complete
examples of libglade usage out on the web.  I found several good ones
using google.  They include complete glade files, the .c file, and
compilation instructions.  

I really don't know why you are saying there are no decent tutorials or
references.  Have you looked at the libglade docs on the web?  
http://developer.gnome.org/doc/API/libglade/libglade.html

In fact, a complete example, complete with compilation instructions is
at:
http://developer.gnome.org/doc/API/libglade/libglade-notes.html#LIBGLADE-BASICS

During the 5 minutes I spent doing some research to answer your original
post, I encountered a problem with their example code where the auto
signal connect routine would complain that it couldn't find symbols.  I
punched the error message into google and learned very quickly that I
had to add a compiler flag to allow the symbols to be found (can't
remember offhand now what it was).

So I don't think we can say the docs are bad or hard to find.  They
really aren't.


 
 I would love to be proved wrong about libglade documentation so please flame 
 me if I am and point out my sins.  Even though I am now able to compile/link 
 libglade code I find that I am now stymied by lack of documentation on its 
 usage. 

After seeing the documentation, what parts of you stymied by?

Michael


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


Re: drawing moving shapes

2007-02-02 Thread Michael L Torrie
On Fri, 2007-02-02 at 16:02 -0700, Rob Barnes wrote:
 I am using gtk_widget_queue_draw() already. The doc says,Once the main loop
 becomes idle (after the current batch of events has been processed,
 roughly), the window will receive expose events for the union of all regions
 that have been invalidated., but this does not seem to be happening.
 Placing a printf in my expose event revealed that expose is not being called
 unless I move the mouse or something like that.  My program is
 multithreaded, could that be causing problems?

I was going to ask if your program was multithreaded as this is classic
behavior when you try to use threads.  

Did you read the documentation on how to properly use threads in GTK?
Are you initializing thread support in gdk?  Do you properly lock gdk
when making any gtk or gdk call from a thread?

In general (on all platforms and all widget toolkits), making gui calls
from the thread is a bad idea.  Instead, notify the main loop when you
want it to do something by doing g_idle_add and a callback.  This
ensures that the callback, which could update the drawing area, for
example, runs in the main thread at the next opportunity.  Note that you
have to synchronize any data that you want to share between threads
using locking primitives.

Michael


 Some code snippets:
 
 GtkWidget *drawing_area;
 
 //Inside main:
 drawing_area = gtk_drawing_area_new ();
 g_signal_connect (G_OBJECT (drawing_area), expose_event, G_CALLBACK
 (expose_event), NULL);
 gtk_widget_set_events(drawing_area,GDK_ALL_EVENTS_MASK);
 
 
 gboolean expose_event( GtkWidget  *widget,
   GdkEventExpose *event )
 {
 printf(expose\n);
 //draw_player(players[0]);
   gdk_draw_drawable (widget-window,
  widget-style-fg_gc[GTK_WIDGET_STATE (widget)],
  pixmap,
  event-area.x, event-area.y,
  event-area.x, event-area.y,
  event-area.width, event-area.height);
 
   return FALSE;
 }
 
 //Inside a asynchronous function
 //marker is an ADT
 gdk_draw_polygon (pixmap,marker.kontext,TRUE,marker-poly,4);
 
 gdk_widget_queue_draw(drawing_area);
 
 
 Thanks.
 -RobB
 
 
 On 2/2/07, Michael Ekstrand [EMAIL PROTECTED] wrote:
 
  On Fri, 2007-02-02 at 12:20 -0700, Rob Barnes wrote:
   I'm trying to write a simple program that draws a moving polygon on the
   screen. I started with the scribble-simple example and modified to draw
  the
   moving shape by redrawing the shape in the background color in the
  previous
   position first then drawing it in the foreground color in the current
   position. It works fine, except it only refreshes when something happens
 
   such as mouse movement, click, expose, window adjustment. So to keep
  things
   moving I have to keep moving the mouse around, but it stops if the mouse
   stops, even though the polygon is being redrawn contently.
 
  Make sure you request a redraw every time the underlying state changes -
  check out gtk_widget_queue_draw.
 
  --
  Michael Ekstrand
  Research Assistant, Scalable Computing Laboratory
  Goanna, compute cluster and InfiniBand network monitor tool:
  http://www.scl.ameslab.gov/Projects/Monitor/
 
 
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

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


Re: Cross compilation error

2006-12-06 Thread Michael L Torrie
On Mon, 2006-12-04 at 11:37 +0530, Shyjumon N. wrote:
 Hi group,
This is a very basic question, if any body can help me i will be glad.
 I am using gtk for my ARM board, i am using eldk development suit and 
 crosstools.
 Can any body tell me how can i cross compile gtk applications for arm target.
 Do i need to configure the gtk package and dependancies for arm ?

Yes.

 Please help me with some clues or links.

You'll likely want to take this up with the mailing lists at
handhelds.org.  They specialize in building software for embedded
devices.

Michael


 Thanks for all supports.
 
 With regds,
 
  
 
 Shyjumon N
 Mobile: +91-9945006965
 
 The information contained in this e-mail message and in any annexure is 
 confidential to the  recipient and may contain privileged information. If you 
 are not the intended recipient, please notify the sender and delete the 
 message along with any annexure. You should not disclose, copy or otherwise 
 use the information contained
 in the message or any annexure. Any views expressed in this e-mail are those 
 of the individual sender except where the sender specifically states them to 
 be the views of SoCrates Software India Pvt Ltd., Bangalore.
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

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


Re: Installing latest gtk+

2006-11-30 Thread Michael L Torrie
On Tue, 2006-11-28 at 20:19 +1100, Andrew Dunkin wrote:
 I tried to install Adobe reader with following result;
 
 [EMAIL PROTECTED] user]$ rpm -ivh AdobeReader_enu-7.0.8-1.i386.rpm
 error: Failed dependencies:
 gtk2 = 2.4.0 is needed by AdobeReader_enu-7.0.8-1
 
 I searched the available packages on my Mandrake 10 system.
 Packages containing gtk2 in their name were numerous.
 The Web is full of variations of gtk+2, which gtk+2 application do I
 need?

You must stick to packages that are specifically for your distro and
version.

Unfortunately installing the latest version of GTK from source will not
solve this problem either.  Compiling GTK from source will cause you
problems.  If you insist on compiling from source you must know what
you're doing and be able to deal with conflicts that inevitably will
arise between the system-install libraries in /usr/lib and the libraries
you compile yourself in /usr/local/lib.  And like I say, even if you try
to do this, this won't help the AdobeReader rpm because a program
compiled from source will not tell the rpm database about itself and
thus rpm will still complain.

 
 I THINK I need GTK+2.10.6 as per the following;
 http://mail.gnome.org/archives/gtk-devel-list/2006-October/msg3.html
 
 The instructions for installation were at;
 http://developer.gnome.org/doc/API/2.0/gtk/gtk-building.html
 
 I have 2 chances of making this work, neither are good.
 Does anyone know where I can get an rpm file or a know of simpler way of
 getting gtk+2.0 installed?

Probably a better place to ask about this is on the Mandriva mailing
lists.  Given that your distribution is now old, your best bet is likely
to simply upgrade to the latest version of Mandriva.  I once compiled
the latest gtk libraries as RPMS for my FC3 box, and that worked, but I
had a lot of dependency issues (had to rebuild more than just the gtk
rpms).  It's quite a pain.  

 Apparently I also have to be careful not to erase gtk+1.x as other
 applications on my system may need it.

You don't need to worry about that as gtk+1 is packaged separately and
the library files can coexist nicely.

 I guess I have to alter path settings as well???

One option is to install GTK2 2.10 to a special prefix.  For example
(don't forget to set PKG_CONFIG_PATH to /opt/gtk2/lib/pkgconfig after
the first module is compiled and installed):

 ./configure --prefix=/opt/gtk2

Then after building all the requisite parts of gtk2, you can write a
script to lauch Adobe Reader (installed from tarball and not rpm to
avoid the rpm complaint about gtk) by setting the following variable:

LD_LIBRARY_PATH=/opt/gtk2/lib

and then running the real binary.

 Is there an installation tutorial out there somewhere for newbies?

The generic instructions (which you mentioned) for building from source
are pretty good.  However they cannot take into account distribution
specific issues.  But as I mentioned before it is just simply not
recommended, especially on a binary package system that supplies system
versions of the GTK libraries.  Problems caused by doing so are the
cause of a lot of pain and frustration on the list, both on the part of
the people trying to compile, and on the part of the developers and
people giving the help.  

If you are willing to take risks, here is how you can replace the system
libraries with ones compiled from source.  Just use  --prefix=/usr as
the configure option for each of the gtk packages.  Then you'll have to
either install Adobe using the tarball or force the rpm.  Be warned that
things may break that are expecting the older version of gtk2.

 
 Installing the latest Adobe reader is becoming bigger than Ben Hur!

As long as the basic requirement is met (a binary rpm of gtk2 = 2.4 is
installed), it is fairly straightforward.  And if Adobe chose to do so,
they could package Adobe Reader such that it provided its own gtk2
libraries like vmware does.  Unfortunately Adobe doesn't really
understand linux all that well.

Michael



 
 
 
 
 NSW Fire Brigades Confidentiality Notice
 
 This electronic transmission, including any attachments, may 
 contain information which is confidential and/or privileged. 
 If you are not the intended recipient of this message, any 
 dissemination, copying or action taken in reliance of its 
 contents is strictly prohibited. If you have received 
 this message in error, please notify the sender immediately.
 
 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: IDE

2006-11-29 Thread Michael L Torrie
On Wed, 2006-11-29 at 10:36 -0700, Chris wrote:
 Hello,
 
 Is there a good IDE for writing GTK applications?

Any C and C++ IDE is good.  For example,
- anjuta
- kdevelop
- eclipse with the CDT plugin

All of these IDEs can manage make files, compiler flags, etc.  I know
that both anjuta and kdevelop have GTK+ and Gnome as project types,
setting up the include and library paths quite nicely.

For rapid gui development, using the glade-2 gui designer is very nice.
Anjuta may integrate glade-2 but I don't know since I now do most of my
programming in gvim; I don't use IDEs that much, except if I have to use
Java (a good IDE is essential for Java since it is so verbose).

Michael


 
 Thanks
 
 Chris
 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: IDE

2006-11-29 Thread Michael L Torrie
On Wed, 2006-11-29 at 15:52 -0300, Mariano Suárez-Alvarez wrote:
 On Wed, 2006-11-29 at 11:15 -0700, Michael L Torrie wrote:
  On Wed, 2006-11-29 at 10:36 -0700, Chris wrote:
   Hello,
   
   Is there a good IDE for writing GTK applications?
  
  Any C and C++ IDE is good.  For example,
  - anjuta
  - kdevelop
  - eclipse with the CDT plugin
 
 MonoDevelop should be of help, too, I guess.

If you're developing in C#, absolutely.  It's very good and has glade
integration.


 
 -- m
 
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Gnome, GTK C+

2006-11-10 Thread Michael L Torrie
On Thu, 2006-11-09 at 09:28 -0800, DANIEL KEENE wrote:
 Hello,
  
 I am a programmer with experience in Assembler and C-C+.  I've
 recently decided to convert my Windows 2000 box to a Linux system. Not
 knowing anything about Linux, I asked several friends for advice about
 platform choice. A couple of them suggested Debian, and using the
 GNOME desktop, that I would like using GTK for my coding platform. As
 well as all of the tools available. As a complete newbie to the Linux
 world, could anyone shed some light on these things, am I being
 steered in the right direction?

As far as just the linux distro goes, debian is probably not the best
choice for newbies.  I'd pick Ubuntu (which is based on debian) as a
great introductory distribution.  Using it's GUI package manager you
should be able to install all the compiler tools and libraries to do
coding for GTK and other things.  Kdevelop, Anjuta, or even Eclipse are
great IDEs.  For GUI development in GTK, Glade is the best tool for
doing layouts (Anjuta might even embed it).

Michael

  
 Thanks,
  
 Dan Keene
 [EMAIL PROTECTED]
  
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Use of fgets, puts, rewind in Gtk+

2006-10-13 Thread Michael L Torrie
On Fri, 2006-10-13 at 10:16 +0530, Sucheta Ghosh wrote:
 Let me clarify the situation one by one:
 
  I can see some problems here, but that's not really GTK-related;
 
 Then my question is: how the same code works fine as a simple c file, when 
 I am not using this inside Gtk+?

Probably because you are just lucky.  Often times code that's not quite
correct can work fine in a small, standalone test case but fails when
run in another context.

By the way you never did post the runtime error message you got.
Unfortunately without knowing what that error was we cannot help you.

 
  1) no error checking for fopen(), fgets() - You don't to anything
if they fail (and that's most probable)
 
 What I have written is only a small piece of code, where I had written the 
 extract only to explain the problem in short. I have done the error 
 checking, the result is fopen() is not getting the null value, but fgets() 
 is getting the null value.
 
 And I have declared all the variables unless it would not compile, as I 
 said earlier this is a runtime problem.
 
  2) can't see any fclose() - multiple fopen()s without closing
the file is BAD :)
 
 I have done it in my Gtk+ coding only did not shown it here.
 
 And all the other things I have done due to the demand of my application.
 
 Thanks  regards,
 Sucheta Ghosh
 
 On Thu, 12 Oct 2006, Progss wrote:
 
  Sucheta Ghosh napisa?(a):
  I wished to read a file and get some lines from there like this:
 -
 fp=fopen(filename, r);
 for(k=0; k8; k++){
 n=a[k];
 for (i=1; i=n; i++) //Here 'n' is the line number
 fgets(s, 100, fp);
 puts(s);
 rewind(fp);
 }
 -
 -
  This is the code snippet, which is working so well after compiling with 
  'gcc' compiler, but when I added this code inside Gtk+ callback.c, a 
  runtime error is occuring before execution of 'fgets'. I have already 
  included 'stdio.h', but even then it is not executing.
  
  Do you have any idea that how to overcome this problem?
 
  I can see some problems here, but that's not really GTK-related;
  well - there's also a change that included snippet was simply
  too short
 
  1) no error checking for fopen(), fgets() - You don't to anything
if they fail (and that's most probable)
 
  2) can't see any fclose() - multiple fopen()s without closing
the file is BAD :)
 
  3) You're reading the same file 8 times - and that's *at least*
  non-optimal - of course that depends on what exactly you're going
  to achieve, however I'm quite convinced
 
  4) I'd be really careful about placing some external file operations
  nside of a callback function. but this depends on your overall
  application purpose and design.
 
  Best regards
  Waldek
 
  --
  Czas pozegnac finansowe problemy.
  Kredyt Citibank - prosty kredyt na wszystkie potrzeby.
  Sprawdz: http://link.interia.pl/f19a5
 
 
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

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


Re: removing borders from button

2006-10-09 Thread Michael L Torrie
On Mon, 2006-10-09 at 18:03 +0530, [EMAIL PROTECTED] wrote:
 Hi,
 
 I have a GtkImage on a GtkButton.
 I want to remove the spacing/border between the GtkButton border and the
 GtkImage.
 Also I want to remove the GtkButton outline.
 I'm using GTK2.0.
 
 Please let me know if there is any way it can be done.

http://developer.gnome.org/doc/API/2.0/gtk/GtkButton.html#gtk-button-
set-relief

 
 Thanks,
 Krithika
 
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

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


Re: GTK Evaluation tool kit

2006-10-06 Thread Michael L Torrie
On Thu, 2006-10-05 at 14:38 +0530, Shyjumon N. wrote:
  
 Hi
 
 Please tell me is there any standard tool kit for the
 performance evaluation of GTK.

Evaluate in what sense?  And what are you trying to evaluate the
performance of?  There are many profiling tools that could be used.

In my opinion, the total throughput of the gui (profiling, raw speed) is
pretty useless in comparison to the performance of your code that
actually gets real work done.  I think in almost all cases (except maybe
video stuff), GTK's speed is all but irrelevant to the overall
performance of an application.  The real question is, how fast does your
application get the things done it was designed to do.  GUIs are just an
interface to the business end of your app.


 
  
 
 With regds,
 
  
 
 Shyjumon N 
 
 TTEC
 
 Tel: +91-80-4180-3500 Extn. 3273 
 
 Mobile: +91-9945006965
 
  
 
 The information contained in this e-mail message and in any annexure is 
 confidential to the  recipient and may contain privileged information. If you 
 are not the intended recipient, please notify the sender and delete the 
 message along with any annexure. You should not disclose, copy or otherwise 
 use the information contained
 in the message or any annexure. Any views expressed in this e-mail are those 
 of the individual sender except where the sender specifically states them to 
 be the views of SoCrates Software India Pvt Ltd., Bangalore.
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

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


Re: gtk layering

2006-10-05 Thread Michael L Torrie
On Wed, 2006-10-04 at 10:58 -0400, Bill Cunningham wrote:
 Sorry. You already said glib is for general programming. Alot to take in
 at once :) I'm mostly interested myself in window creation and events
 relating to that. If gtk+ has it's own would it work without X or is X
 needed indirectly?

You're interested, then, in the Gdk library.  This is the library that
is typically ported (along with cairo) to other graphical systems such
as the frame buffer, X11, win32, Quartz (via carbon or cocoa.), etc.

Glib is definitely for general programming.  In fact it is so powerful
that *all* c programmers (well excluding system and kernel programmers)
should use glib as a matter of course for all data structures, strings,
and memory management.  I believe glib should be a part of the C
standard library.  Doubt that will happen, but consider it at least as
useful.  

Michael


 
 Bill
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: gtk layering

2006-10-05 Thread Michael L Torrie
On Wed, 2006-10-04 at 01:07 -0400, Bill Cunningham wrote:
 I know for those of us who want to use gtk as an API it is there. Gnome
 is built on gtk of course. But what about gtk? Does it call directly glib or
 the X windowing system for frame buffer support?
 
 gtk
 glib-2
 x windows
 
 or does gtk work more like this?
 gtk
 /\
 glib X
 
 Simplified of course then there's pango and cairo and pangocairo.. :)

Hopefully we can get some real experts to help improve and clarify it,
but here is a little simplified diagram that represents to me how Gtk's
layers work on X11:

+---+
|  Gtk+ |
|   +--+|
|   |  Pango   ||
|   | +++
|   | |Gdk  |
+---+-+-+   |
|   Cairo   |   |
+---+---+
| X11   |
+---+

The following things are not illustrated in this diagram or are
inaccurate:

- Pango talks directly to X11 for dealing with core fonts and using
Xrender to draw freetype fonts (although the pango cairo backend uses
cairo for this).  To draw directly to X11, pango just needs to ask Gdk
for the window contexts.  Does Pango use Gdk at all, except to get X11
window contexts?

- Cairo can and is often used outside of the Gtk context (it is a
standalone app api)

- Cairo can talk to the Glitz backend which sort of side-steps X11 and
renders directly to an OpenGL context

- Under Windows Pango most often renders fonts using the Win32 GDI,
bypassing Cairo and Gdk.

If anyone can clarify, simplify, or make more accurate this diagram,
please do so so we can all get a better understanding and appreciation
of the Gtk architecture, which like Bill, I find fascinating.

Michael


 
 Bill
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: gtk layering

2006-10-05 Thread Michael L Torrie
On Thu, 2006-10-05 at 10:32 -0600, Michael L Torrie wrote:
 Hopefully we can get some real experts to help improve and clarify it,
 but here is a little simplified diagram that represents to me how Gtk's
 layers work on X11:
 
 +---+
 |  Gtk+ |
 |   +--+|
 |   |  Pango   ||
 |   | +++
 |   | |Gdk  |
 +---+-+-+   |
 |   Cairo   |   |
 +---+---+
 | X11   |
 +---+
 

Hmm. From what the pango.org site says, pango only depends on glib
(which is not shown in this diagram since it's a foundation class
library), not Gdk or Gtk.  So it would appear to only be on top of Cairo
and X11.

Michael

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: gtk layering

2006-10-05 Thread Michael L Torrie
On Thu, 2006-10-05 at 18:42 -0400, Bill Cunningham wrote:
 Sounds to me more and more that X11 is more irrelevant to gtk and gdk.

Ideally Gdk should have an abstraction layer sufficient that only a thin
gdk backend layer is needed for any windowing system, such as X11 or
Win32.  This is becoming a reality.  There used to be a lot of X11-isms
both in Gtk and Gdk in the past.  Things are much more portable now.
Gdk does still needs to know how to talk to X11 (just like on windows it
needs to talk to the win32 GDI).  It's that part that is rewritten to
talk to a framebuffer directly, or to Win32.

This is off-topic, but it's my opinion the framebuffer target is most
often not going to buy you anything.  On embedded devices you may as
well run the kdrive tiny X server rather than use the framebuffer since
if you use the framebuffer, GdkFB has to implement windowing itself,
which is just doing things that Kdrive and a good tiny window manager
already do well.


Michael

 
 
 Bill
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: modern linux

2006-09-25 Thread Michael L Torrie
Just a suggestion here, but you've started nearly a dozen new e-mail
threads over the last couple of days.  Could you just reply to the
existing thread rather than start a new one each time, since you're
still talking about the same things?  New threads generally are for new
topics. 

thanks

Michael

 
 Bill
 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: why???

2006-09-08 Thread Michael L Torrie
On Thu, 2006-09-07 at 19:35 -0700, dagang001 wrote:
 #include glib.h
 
 typedef struct {
 gchar * name;
 gint shoe_size;
 gint age;
 } Person;
 
 
 int main(int argc, char** argv) {
 Person *fred = g_new(Person, 1);
 GList *list = NULL;
 
 gint num,i;
 gchar *ming[]={aaa,bbb,ccc,ddd};
 
 
 for ( i=0 ;i4 ;i++)
 {
 fred-name = ming[i];
 fred-shoe_size = i+10;
 fred-age=60+i;
 list = g_list_append(list, fred);
 }
 
 
 num=g_list_length (list);
 
 for (i=0 ;inum;i++)
 {
 g_print(%d '%s' %d  %d \n, i,
 ((Person *)g_list_nth (list,i)-data)-name,
 ((Person *)g_list_nth (list,i)-data)-shoe_size,
 ((Person *)g_list_nth (list,i)-data)-age);
 }
 
 
 
 g_print(long%d \n\n, num);
 g_list_free (list);

 ^^
This is a memory leak.  You still have person (one instance only) fred
allocated.  If you did this exercise right, and allocated a new Person
object for ever g_list_append, then you'd have 4 leaked person objects
at this point.  

Supposing you did allocate a new Person object for each list item, you'd
need to do this before the g_list_free call (I think):

g_list_foreach(list,g_free,NULL);

While C does require very manual tracking of memory allocation and
deallocation, the glib routines make it very easy to clean up after
yourself.  In fact many of the data structures, including the trees,
hashes, and so forth, allow you to assign destructor functions that
are called on each item in the structure when the structure is freed.
Using these wonderful routines, I create and destroy thousands of very
large and dynamic tree structures without a single memory leak.
Amazing.  I love glib!  I think it should be part of the standard C
library.

Michael


 g_free(fred);
 
 return 0;
 }
 
 
 result:
 
 0  'ddd' 13 63
 1  'ddd' 13 63
 2  'ddd' 13 63
 3  'ddd' 13 63
 long4
 
 help me !!
 
 

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


Re: Xfree86 for IMX31/ARM11

2006-08-21 Thread Michael L Torrie
On Mon, 2006-08-21 at 18:49 +0530, harshavardhanreddy mandeepala wrote:
 Hi All,
 Does any body crosscompiled XFree86(Xserver) for ARM processor.
 If so kindly send the procedure .
 My host system is i386 linux (SUSE/FC4)
 Target system is arm (IMX31 freescale processor with ARM11 Core)

Likely XFree86 is a poor choice for an embedded system.  The better
choice is the kdrive X server which is very small and works very well
for small, arm-based devices.
http://kdrive.freedesktop.org/wiki/Software_2fXserver

Besides being small, this X serve uses standard autoconf configuration
scripts so the source code can easily be built in a cross-compiling
environment.  The procedure is exactly the same as cross-compiling any
application, so you shouldn't have any problems.  

Unfortunately, because of XFree86's antiquated build system, cross-
compiling that beast will be very difficult.  If you're determined to
use a non-embedded X11 system, you'll likely want to use X.org's X
server instead (XFree86 is considered deprecated by most folks) which is
modularized and builds using standard autoconf tools, so cross-compiling
is relatively easy.

Michael


 
 Thanks in advance.
 
 Regards,
 Harsha 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: GTK is double buffered by default ? on GNU/Linux and MS Windows ?

2006-08-11 Thread Michael L Torrie
On Fri, 2006-08-11 at 09:57 +0200, Clemens Eisserer wrote:
 Hi again,
 
 Well there has been a lot of discussion about GTKs performance, wether
 its fast or not.
 I just found that moving a window on top of a GTK window on Windows I
 get 100% CPU on a XP2200+/WindowsXP and visible repaint lags - be that
 slow or fast ... I don't want to comment.

GTK performance on Windows is a red herring, really.  And from what I
can see, probably because of the way windows events work, GTK apps will
freeze all their windows while moving the window, so you won't see lags
in the repaint; you'll just see nothing until the window is moved and
then you'll see the repaint which may or may not be as fast as you think
it should be.  Under Xgl, and any of the new opengl backends, you should
find almost no cpu use when dragging the window.

 Tearing is caused by the fact that applications don't paint themself
 fast enough, not because drawing is not synchronized. Draw a window on
 top of a maximized xcalc and you won't see any tearing.

You are wrong. The visible application redraw, either during expose or
configure events, is very much a synchronization issue.  Sure redrawing
at light speed would eliminate the symptom, but it wouldn't address the
problem (and it would be very inefficient anyway).

Sure Xcalc redraws itself fast enough so as not to have visible
redrawing because the ops are very simple.  However, most of the time on
my fast nvidia graphics card and machine I can't see GTK apps redraw
either.  GTK is orders of magnitude more complicated and intensive that
the Xaw widgets.  GTK widgets are all dynamically sized on the fly.
That is one reason why GTK may be slower to redraw than Xaw.  But Xaw is
not very useful and you wouldn't want to make a full app out of it.

Back to synchronization.  The problem is that as you rapidly move one
window past another, or resize a window, the events queue up and ask the
app to redraw.  However the redraw app will likely have to happen all
over again before redraw is finished. So GTK queues up the events,
halting the redraw momentarily.  The upshot of this is that you save a
lot of CPU and in the end redraw faster (cause you're only doing it 5
times instead of 1000), but there is visible stutter.  If the redraw
events and the movement of the windows are synchronized according to a
frame rate, everything does get smoother.  The biggest win here is
resizing a window.  With the proposed X11 synchronization extension
stuff (as I understand it), GTK app resizes will be silky smooth (well
at a frame-rate your computer can handle CPU-wise).  

Here is a quote from an unknown source that explains it better: Because
X11 is asynchronous, as the window resizes, configure and expose events
are sent to the GTK widgets to get them to redraw. Because of this
asynchronous nature, until recently there was no good way to synchronize
the redrawing to the actual expanding of the window, as OS X and Windows
do. This is changing and a synchronization mechanism is being built into
X11 that will allow Gtk (and Qt and any other widget set) to be able to
resize fluidly.

 This is basically wrong. Drawing primitives through OpenGL is very
 likely to be a lot slower than through accalerated X11 drivers, I
 would give x11perf a try on XGL.
 I would not consider drawing to be the largest problem anymore,
 espacially when it comes down to GTK+ performance problems. Readbacks
 and

No you are incorrect.  OpenGL is not only fast at 3d but also 2d.
However this is beside the point.  Xgl uses OpenGL to display window
contents as textures. Thus GTK apps render as normal (or with Cairo) to
a texture in memory (just like they did before), but this texture is
rendered to the screen, with special effects like shadows and
transparency at 30-60 frames per second.  Cairo is also moving to render
paths directly in OpenGL, which should speed up all advanced Cairo
operations.

 Well thats not OpenGL related and is basically what a Composition manager 
 does.
 However toolkits should be fast enough also without composition, and a
 lot toolkits prove that it is no problem for them (Fox-toolkit, fltk,
 qt, win32, ).

Of course.  But openGL makes the composite manager very fast.  In short,
composite is slow and CPU intensive without OpenGL.  This allows windows
to move without any redraw at all, very quickly, and with transparency,
3-d effects, full Xvideo support/emulation, etc.  Interestingly enough,
I tried out composite years ago back on a Vesa-only X server (some
experimental server from freedesktop.org) and even though we *know* that
Vesa is slower in every way, composite made it feel faster.  It wasn't
really, but it seemed that way.  With OpenGL it can seem faster and
actually be faster too (or at least as fast as it always was).

In answer to your original question, GTK apps are double-buffered at the
widget level, not the window-contents level.  Xgl and AIXGL (composite
generally) make all apps double-buffered at the 

Re: GTK is double buffered by default ? on GNU/Linux and MS Windows ?

2006-08-11 Thread Michael L Torrie
On Fri, 2006-08-11 at 17:28 +0200, Clemens Eisserer wrote:
 Hi again,
 
  then you'll see the repaint which may or may not be as fast as you think
  it should be.
 And how can you explain the 100% CPU useage? If it would be idle or
 supress redraws it would not need that many cycles.

you are talking about Windows here?  Or Linux?  If it is Windows, well
all bets are off.  GTK is an X11 toolkit ported to a win32 drawing
layer.  It is not going to be ideal on Windows.  I move my windows on
linux and don't wee 100% cpu, except in frequent, occasional (and
expected) spikes.

 
  frame rate, everything does get smoother.  The biggest win here is
  resizing a window.  With the proposed X11 synchronization extension
  stuff (as I understand it), GTK app resizes will be silky smooth (well
  at a frame-rate your computer can handle CPU-wise).
 A simple example - placing two tables with some data (maybe 10 text
 clumns) in a PannedWindow maximize the window to 1600x1200 and move
 the gripper. CPU goes up to 100% while animation is slow.
 This has nothing to do with event processing - at least 10% of total
 CPU time is spent in glibs data structures. This is on a 2.6ghz
 pentium 4 Northwood - so I don't talk about pentium1 or 486.

Just because 10% of the cpu time is spent in the glibs data structures
in no way means that it isn't event processing that is taking the time.
Event processing (reacting to the events) is handled in the GDK and GTK
libs.  I am unsure of what you are trying to prove here, other than the
100% cpu usage.

 
  X11 that will allow Gtk (and Qt and any other widget set) to be able to
  resize fluidly.
 Well I don't have any problems with QT, Fox-Toolkit or Fltk.
 And I would call QT even more feature-rich and fatter - but it does
 not suffer from those performance problems.

Qt *does* have the same problems generally (stuttering, redraws).

 
  No you are incorrect.  OpenGL is not only fast at 3d but also 2d.
  However this is beside the point.
 OpenGL is fast if you do special stuff thats not possible through X11
 (where you would e.g. need software fallbacks) but most guys draw
 lines and fill rects and this is where OpenGL really sucks - just
 because its much more complex and has a deeper ... I would call it ..
 well ... driver pipeline.
 Thats also why NVIDIA developers said that they would support a major
 transition to XGL but they would not recommend it from the performance
 pov. and these guys should know ;-)

You're missing the point.  Xgl currently doesn't use OpenGL for
rectangles and lines.  It uses OpenGL to rapidly render textures.  So
there's no speed penalty at all.

And frankly the NVidia comments are bogus, or at least misunderstood by
you.  Xgl is an X server that runs on top of X11, so there's overhead
there.  NVidia *is* supporting the method used by AIXGL, which *is*
fast.  These technologies *will* make everything including Qt, Gtk, FLTK
feel faster (except in your divider drag example).

 
  Of course.  But OpenGL makes the composite manager very fast.  In short,
  composite is slow and CPU intensive without OpenGL.
 No - why should it be slow? I don't talk about effects, just good
 plain old composition maybe with shadows. This can be done through
 XRENDER without any CPU hit (at least on my nvidia gpu). If you don't
 use fancy effects composition can even be done using the old core
 instruction set, painting pixmaps is accalerated more or less
 everywhere.

Umm composite is naturally slow because each window layer has to be
mathematically combined together before displaying on the window.
OpenGL offloads this to the render hardware which does this kind of
thing at 60 frames a second.  Yes Nvidia's driver can offload composite
to the card.  But in the case of the nvidia driver, composite is very
buggy and it is recommended you disable it.  BUT, as you know perfectly
well, with composite turned on, moving one GTK window across another
feels fast and smooth with no tearing or stuttering.  Xgl and AIXGL make
composite a stable standard. 

 
  In answer to your original question, GTK apps are double-buffered at the
  widget level, not the window-contents level.
 GTK's widget are double-buffered at window-level, I would have a look
 at gdkwindow.c.

Each GTK application window consists of dozens or hundreds of gdk
windows.  In X terminology, a window is a small region that accepts
events from the X server.  Each widget that receives events like clicks
is a GdkWindow (and also an X Window).  I could be wrong, but I believe
that this point has caused you to understand GdkWindows and double-
buffering incorrectly.

Therefore, I don't believe GTK apps are double-buffered at the window-
contents level.  If they are, I believe the code would be in GtkWindow,
not GdkWindow.

Besides that, it's really not GTK's place to double-buffer the entire
application window.  That's the responsibility of the X server (and
composite does do this).

 
  I doubt you'll find anyone complaining 

Re: GTK is double buffered by default ? on GNU/Linux and MS Windows ?

2006-08-10 Thread Michael L Torrie
On Thu, 2006-08-10 at 16:34 +0200, KLEIN Stéphane wrote:
 Hello,
 
 I use Ubuntu system. I've showed gnome and Gimp to one friend. This
 friend use MS Windows since always.
 
 He say : I dislike Linux, Ubuntu, Gnome, Gimp ... because the GUI
 display scintillate. This also for Gimp MS Windows version. 
 
 He say : First, I see the window draw, next the background draw of
 button On the contrary, MS Windows application display all widget
 in one step.
 
 I don't know if you understand my subject. 
 
 My question : is there double buffering render in GTK ? If yes, why my
 friend think than Windows display is faster than GTK and other widget
 toolkit ? If not, why that ?

It is a matter of perception.  I cannot say whether GTK renders faster
than Windows. But GTK is double-buffered.  However what your friend is
seeing is a result of a couple of things.  

First is that when you uncover a window, X11 sends expose events to the
uncovered window. It is up to the client (the app) to respond to these
events and redraw the parts that were exposed.  If the window is in
motion, these expose events may come faster than the app can deal with.
GTK typically compresses these events and will wait to do the actual
redraw.  This reduces the CPU consumption and increases overall speed,
but it comes at the expense of visual stuttering.  

One is that the X windowing system in asynchronous. This means, among
other things, that the windowing code accepts requests as they come from
various clients (apps).  These means that redraws and reconfigures of
the various applications aren't necessarily going to happen at the exact
same time.  Also when you drag a window, for example, the redrawing
isn't synchronized to any particular clock, so you get tearing.  Windows
also often has tearing when you drag a large window around.  Mac does
not, for reasons I'll describe below.

Work is being done to address these perceptions (speed really is fast;
it just looks slow).  First of all, people are developing X servers that
use OpenGL to draw the windows on the screen.  What this means is that
apps draw to an off-screen bitmap, which OpenGL then pastes on the
screen.  Since the OpenGL drawing is very quick, this eliminates redraw
flicker to a large degree (since the flicker is hidden off-screen where
you can't see it).  Also when you move a window, the window underneath
is intact (it's an opengl texture) so there are *no* expose events
needed.  This doesn't address the resize stuttering issue, though (even
Mac OS X stutters on resizes on slow video cards).  This will be
addressed through new synchronization events that the X server will use
to make sure everything happens smoothly, without any stuttering.  

If you want to see how fast a Linux desktop can appear, check out the
new OpenSuSE with it's Xgl system.  It's sweet!  Fedora Core 6 will have
similar technology, called AIXGL.  Besides providing fast rendering
(which will definitely quell your friend's complaints), it also enables
lots of other cool things like 3-d desktops, OS X-like expose, etc.  See
http://www.freedesktop.org/~davidr/xgl-demo1.xvid.avi , and also
http://kororaa.org/

Michael


 
 Thanks for your response.
 --Stéphane 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: How to copy data between widgets?

2006-08-08 Thread Michael L Torrie
On Tue, 2006-08-08 at 11:48 -0300, Román Gorojovsky wrote:
 As I said before, It's a problem with my C, not my gtk.  A quite
 embarrassing mistake, sorry for wasting your time.

Another way to do it is to assign each widget a string name using
g_object_set_data.  Once this is set, then in your callback you can use
the emitting-object's GtkWidget pointer to lookup the parent widget and
then search down the widget hiearchy for the named label widget.  

Glade-generated code (which is of course deprecated but demonstrates
this solution) does this:

#define GLADE_HOOKUP_OBJECT(component,widget,name) \
  g_object_set_data_full (G_OBJECT (component), name, \
gtk_widget_ref (widget), (GDestroyNotify) gtk_widget_unref)

#define GLADE_HOOKUP_OBJECT_NO_REF(component,widget,name) \
  g_object_set_data (G_OBJECT (component), name, widget)



GtkWidget*
lookup_widget  (GtkWidget   *widget,
const gchar *widget_name)
{
  GtkWidget *parent, *found_widget;

  for (;;)
{
  if (GTK_IS_MENU (widget))
parent = gtk_menu_get_attach_widget (GTK_MENU (widget));
  else
parent = widget-parent;
  if (!parent)
parent = (GtkWidget*) g_object_get_data (G_OBJECT (widget),
GladeParentKey);
  if (parent == NULL)
break;
  widget = parent;
}

  found_widget = (GtkWidget*) g_object_get_data (G_OBJECT (widget),
 widget_name);
  if (!found_widget)
g_warning (Widget not found: %s, widget_name);
  return found_widget;
}

GtkWidget*
create_window1 (void)
{
  GtkWidget *window1;
  GtkWidget *vbox1;
  GtkWidget *label;
  GtkWidget *entry;
  GtkWidget *button;

  window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title (GTK_WINDOW (window1), _(window1));

  vbox1 = gtk_vbox_new (FALSE, 0);
  gtk_widget_show (vbox1);
  gtk_container_add (GTK_CONTAINER (window1), vbox1);

  label = gtk_label_new (_(label1));
  gtk_widget_show (label);
  gtk_box_pack_start (GTK_BOX (vbox1), label, FALSE, FALSE, 0);

  entry = gtk_entry_new ();
  gtk_widget_show (entry);
  gtk_box_pack_start (GTK_BOX (vbox1), entry, FALSE, FALSE, 0);

  button = gtk_button_new_with_mnemonic (_(button1));
  gtk_widget_show (button);
  gtk_box_pack_start (GTK_BOX (vbox1), button, FALSE, FALSE, 0);

  /* Store pointers to all widgets, for use by lookup_widget(). */
  GLADE_HOOKUP_OBJECT_NO_REF (window1, window1, window1);
  GLADE_HOOKUP_OBJECT (window1, vbox1, vbox1);
  GLADE_HOOKUP_OBJECT (window1, label, label);
  GLADE_HOOKUP_OBJECT (window1, entry, entry);
  GLADE_HOOKUP_OBJECT (window1, button, button);

  return window1;
}


This is somewhat arbitrary, and you could use your own method for doing
the names and searching.  I've found this type of thing to work very
well.

Michael


 
 Thanks a lot again.
 
  Cheers,
  -Tristan
 
 
 

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


Re: Installing more than 1 version of Gtk+

2006-07-03 Thread Michael L Torrie
On Sun, 2006-07-02 at 18:09 +0800, Stephen Ng wrote:
 Michael,
 
 Thanks for taking the trouble to reply.
 
 I hope you don't mind is I pick your brain i order to get this right!!
 
 When compiling gtk+, I should use -
 
 ./configure --prefix=/opt/gtk2.8
 make
 make install
 
 I believe I should then include the new path in /etc/ld.so.conf and run 
 ldconfig to update the database.

No, don't put this path in ld.so.conf; it will just confuse apps that
are wanting gtk 2.4 in the normal paths.  Rather, before running apps
you've compiled to use /opt/gtk2.8, do:

export LD_LIBRARY_PATH=/opt/gtk2.8

 
 Then when compiling any gtk based program, I should set
 PKG_CONFIG_PATH=/opt/gtk2.8/lib/pkgconfig

add export to the front of that.

 
 In order for the compile to work, I should use -
 `pkg-config --cflags gtk-2.0 --libs gtk-2.0`

Yeah.

 
 in the script. I note that the version number in that script is the same 
 for gtk v2.4.

Yup.

 
 Si, if I wish to go back to my v2.4 install, I should change 
 PKG_CONFIG_PATH back to the default

If you wish to compile against the stock gtk install, just unset
PKG_CONFIG_PATH.  Pre-compiled apps don't care about this variable.

 
 Is this right?
 
 Another question: will I have to install the new versions of glib, pango 
 and atk in the same way i.e. in different directory e.g /opt/glib2.8 etc ?

Yes.  All the dependencies should be built to be in the same place.
This actually don't need to be strictly true, but it makes it easier.
You might find it useful to download and use the garnome builder utility
to automate setting up the latest gtk (and optionally gnome 2.14 or
whatever).

Michael


 
 Regards.
 
 Stephen
 
 Michael Torrie wrote:
  On Sat, 2006-07-01 at 14:01 +0800, Stephen Ng wrote:

  Hi!
 
  I am running on a standard FC3 and was wondering if it is possible to 
  install the latest Gtk+ (v2.8) simultaneously with the existing v2.4. If 
  so, how do I do that and when linking what do I need to do to pick the 
  right version of the library?
  
 
  Sure you can, as long as the prefix the new version installs to is not
  in /usr.  If the prefix you installed gtk to was /opt/garnome, for
  example you would configure like so:
 
  PKG_CONFIG_PATH=/opt/garnome/lib/pkgconfig ./configure
 
 

  Thanks.
 
  Stephen
  ___
  gtk-list mailing list
  gtk-list@gnome.org
  http://mail.gnome.org/mailman/listinfo/gtk-list
 
  
 
 

 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: 回复: Re: Using GTK+ with C++

2006-06-26 Thread Michael L Torrie
On Mon, 2006-06-26 at 10:36 +0800, yeajchao wrote:
 hello
  when i using gtk+ with c++,how can i compile my application?

The same way you do it with C, except you have to use g++ instead of
gcc.  But the command line arguments for doing the build and using pkg-
config to get the cflags and ldflags is the same.

Michael


 
 --- Chris Vine [EMAIL PROTECTED]写道:
 
  On Sunday 25 June 2006 17:17, Paulo J. Matos wrote:
   Hi all,
  
   I know about gtkmm but if I wish to use GTK+ directly, can I do it
   through C++? Is anyone doing this? Are there any 'tricks' I should
   know about beyond having to extern C the includes of gtk header
   files?
  
  They are already declared extern C if compiled for a C++ program.  There 
  is
  
  nothing you need to know - just use them.
  
  Chris
  
  ___
  gtk-list mailing list
  gtk-list@gnome.org
  http://mail.gnome.org/mailman/listinfo/gtk-list
  
 
 
 
   
 ___ 
 雅虎免费邮箱-3.5G容量,20M附件 
 http://cn.mail.yahoo.com/
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Gtk+ Modality Problem

2006-06-21 Thread Michael L Torrie
On Wed, 2006-06-21 at 18:11 +0200, Atanas Atanasov wrote:
  Don't forget to set the transient window:
 
  gtk_window_set_transient_for(GTK_WINDOW(window),GTK_WINDOW(parent_window));
 
 I saw this option, but I would like to make the messagebox work
 independently of the window from which it is called. Is this possible?
 What I need is exatcly the behaviour of a modal MessageBox under
 Windows.

This may not be possible.  Under X11, there is not yet a widely used
idea of windows belonging in a group together (grouped by application).
Windows and dialogs are more independent on X11.  So unless you use the
set_transiet_for, the window manager likely won't have any idea which
windows the dialog should be set modal for.

Also remember that many window policies are set by the window manager,
not your app, so behavior will often be different on different desktops.
All you can and should do is give hints to the WM (using
set_transient_for, etc) and leave it at that.

Michael

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

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


Re: Please help me..

2006-06-20 Thread Michael L Torrie
On Tue, 2006-06-20 at 16:36 +0530, Kalli Math wrote:
 hi all...
 
 I am doing GUI for audio players using *GTK* as framework. i have to 
 design a *playlist* which contains files from one* directory*, on 
 selecting file from playlist another window should open,which contains 
 play,* pause and stop buttons and one progress bar*. i have to write 
 *events* for those play  all buttons. if anybody have idea of this 
 please help me. or tell me where i get source code of this.

Do you have a specific question?  I doubt anyone here will write your
program for you. 

 
 
 with regards,
 Prashanth km
 
 
 SASKEN RATED Among THE Top 3 BEST COMPANIES TO WORK FOR IN INDIA - SURVEY 
 2005 conducted by the BUSINESS TODAY - Mercer - TNS India
 
SASKEN BUSINESS DISCLAIMER
 This message may contain confidential, proprietary or legally Privileged 
 information. In case you are not the original intended Recipient of the 
 message, you must not, directly or indirectly, use, Disclose, distribute, 
 print, or copy any part of this message and you are requested to delete it 
 and inform the sender. Any views expressed in this message are those of the 
 individual sender unless otherwise stated. Nothing contained in this message 
 shall be construed as an offer or acceptance of any offer by Sasken 
 Communication Technologies Limited (Sasken) unless sent with that express 
 intent and with due authority of Sasken. Sasken has taken enough precautions 
 to prevent the spread of viruses. However the company accepts no liability 
 for any damage caused by any virus transmitted by this email
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: graphics!!

2006-05-08 Thread Michael L Torrie
On Mon, 2006-05-08 at 22:27 +0300, Juhana Sadeharju wrote:
 I think you may need to use a canvas. For example:
 http://developer.gnome.org/doc/API/2.0/libgnomecanvas/index.html
 http://www.dachaplin.dsl.pipex.com/goocanvas/
 
 Do they have a graph widget? Or are they more primitive?

No. GTK only provides primitives.  There have been several graph widgets
implemented using GTK.  

 
 I need such a widget in audio apps:
 (1) Envelopes drawn over the audio waveform widget.
 (2) Frequency response curves of multiple parametric filters
 drawn in one canvas.
 (3) Control envelopes.

All of these things would need to be implemented using primitives.  GTK
is just a GUI toolkit, not a domain-specific toolbox.  Audacity (which
uses wxWidgets not GTK) implemented their own widgets for dealing with
waveform graphs and selections and things.

 
 Much of the stuff what can be seen in VST plugins, in Absynth
 (specially envelopes), Waves' plugins, etc. They look nice too
 unlike what I most see here.
 
 Does GTK canvases provide transparency? What programs uses the
 canvases? I might want see how they look like.

There is no GTK canvas officially yet.  There are several
implementations of canvases for GTK including gnome-canvas, foo-canvas,
etc.  They vary in purpose and function.

 
 With gtkglext/opengl all seems to be eventually simpler.
 Multiple widgets can be combined by using suitable transparency
 and depth coordinates. Decorations are done easily, e.g., by
 modeling objects in 3D. But then I cannot use the GTK widgets
 indistinctly. Interaction with the opengl objects comes a problem
 as well, making it tempting to use, e.g., OSG (openscenegraph.org).
 But that is a large software and written with C++, which could be
 a problem if I want code in C.
 
 How would GTK's Cairo integration help? If at all.

Using Cairo do do you drawing of wave forms, envelopes, etc is a good
idea if Cairo is fast enough to do what you need to.  Certainly it seems
to me that a waveform graph, envelopes, etc would be well-suited to a
vector-drawing API.

 
 Juhana

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


RE: GTK with GCC 4.1 on Fedora Core 5

2006-05-04 Thread Michael L Torrie
On Thu, 2006-05-04 at 09:48 -0600, Karihaloo, Ujjval wrote:
 Hi,
 
  I am not sure if the GTK+ 1.2.10 version that I have is a developer
 version. How can I find out?

What he means is that you need the -devel package which includes the
necessary header files and link libraries.  To install them on FC5,
probably you need to run as root:

yum install gtk+-devel

After you do this, you can compile any GTK 1 program with something
like:
gcc -o gtkprog gtkprog.c `gtk-config --cflags --libs`

Most of the apps you'll download and compile will find the gtk-config
program and get the cflags and library flags automatically.

Michael


 
 -Original Message-
 From: David Necas (Yeti) [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, May 04, 2006 2:45 AM
 To: Karihaloo, Ujjval
 Cc: gtk-app-devel-list@gnome.org
 Subject: Re: GTK with GCC 4.1 on Fedora Core 5
 
 On Wed, May 03, 2006 at 09:17:59PM -0600, Karihaloo, Ujjval wrote:
  ./configure: line 5028: syntax error near unexpected token `1.2.0,'
  ./configure: line 5028: `AM_PATH_GTK(1.2.0, ,'
 
 configure was generated on a system lacking gtk+-devel,
 AM_PATH_GTK() was undefined then and thus left unexpanded.
 If you re-generate configure now, it should be OK.
 
 Yeti
 
 
 --
 Anonyms eat their boogers.
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

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


Re: Cross-platform apps

2006-04-26 Thread Michael L Torrie
On Wed, 2006-04-26 at 16:12 +0200, Cesc wrote:
 I agree on all the advice you are given here ...
 My experience is that it is not piece of cake, but it can be done.
 Test often and plan compatibility since the very beginning.
 Then, i would recommend you take a look at other projects which are
 cross-platform and you borrow from there ... for example, i am
 involved with MiniSIP (www.minisip.org), which is builds on linux,
 win32 and wince. The approach is to isolate OS dependent calls in
 compatibility layers (in minisips case, libmutil and libmnetutil), so
 you have a stable API which compiles the appropriate code depending on
 the platform.

Definitely doing your own this abstractions is very important.  This
doesn't always mean making lots of #ifdefs and #defines, or wrapper
functions either.  In many cases this means you've completely separated
your backend code from your frontend (the UI).  If you completely
modularized the backend to the point that OS-specific things can be
compartmentalized into their own modules which can be selected at
compile time, you will be much more successful.  I believe this is a
better approach than trying to limit yourself to the most common
denominator c library calls.  For example I have written one program
that uses asynchronous socket i/o.  Because of the design of the backend
code, I can move my state machine engine to threaded-i/o without a lot
of problem for platforms where that may be better (just an example
that's not necessarily relevant).

One thing I find that helps make the backend more portable is heavy use
of glib (the underlying utility library from gtk).  This can allow you
to do file i/o on a variety of OSes and file systems and not worry about
things like path separators.  For areas where glib doesn't cover
directly, like socket i/o, having an OS-specific module would be needed.

On the frontend, GTK does provide some portability and abstraction that
works well on Windows and Linux, but not so much on OS X yet.  For this
reason I have been using Qt a lot lately, since Qt 4.1 is now very
native on Windows and OS X.  But if your target is X11 and Win32, gtk
works very well.  However it is not always a good idea to tie your UI
(gtk) so closely to the backend that it would not be possible to change
out the GUI down the road and use something else (something native for
example, like, heaven forbid, win32).  Abiword chose this route.  The
backend code is shared between platforms but the UI is, to my knowledge,
specific to the OS.

I have written several programs recently in Qtk (and Qt) with the
intention to run them on several platforms and, having planned for this
from the beginning, have been quite successful.  For just a little bit
of effort up front (which turns out to be good practice anyway), you'll
find the transition from platform to platform to be relatively simple.
Makes me wonder why any application developer would ever intentionally
tie himself to one platform regardless of that platform's market share.


Michael

 
 Good luck!
 
 Cesc


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


Re: Cairo support

2006-04-26 Thread Michael L Torrie
On Wed, 2006-04-26 at 11:14 -0400, Antonio Gomes wrote:
 what version are you talking about ? If 2.8.x I presume 'no' ...

This is unfortunate.  Cairo adds some bulk to the gtk runtime size.
It's another set of dlls and config files that have to be shipped and
installed for applications targeting MS Windows.  Although I do
anticipate that more and more apps will be using cairo to draw and
things.

Currently The GTK 2.4 runtime installation for Windows that I have
installed is standing about 23 MB and 400 files (locales, xml files,
config files, etc).  Without locales we're down to 13 MB or so.  Add in
Cairo and that adds another megabyte or two for 2.8.  Compare that to Qt
4.1 which weighs in between 7 and 10 MB and consists of 3-5 dlls
(depending on the parts you use).  Qt is of course C++ and has libraries
like SQL and Socket IO that gtk doesn't have.  Just an observation.
Don't take this as a complaint. (no really :)

Michael



___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Cairo support

2006-04-26 Thread Michael L Torrie
On Wed, 2006-04-26 at 17:26 +0100, Iain * wrote:
 On 4/26/06, Michael L Torrie [EMAIL PROTECTED] wrote:
 
  Currently The GTK 2.4 runtime installation for Windows that I have
  installed is standing about 23 MB and 400 files (locales, xml files,
  config files, etc).  Without locales we're down to 13 MB or so.  Add in
  Cairo and that adds another megabyte or two for 2.8.
 
 Is that stripped?
 libcairo here unstripped is only 400k.

You are correct.  libcairo is under 400k.  Further, the average install
of gtk on windows hasn't grown much, still being around 10 MB unpacked
(without the locale files) into the common files/gtk/2.0 folder.
Compressed into the installer, the GTK runtime sits at about 4 mb, which
is small enough to bundle (Qt compresses down to about the same size).
I think this is small enough to not worry about the extra burden of
cairo.

Michael


 
 iain
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: rpm of GTK libraries for Red hat 4

2006-04-18 Thread Michael L Torrie
On Mon, 2006-04-17 at 14:20 -0600, Michael L Torrie wrote:
 On Mon, 2006-04-17 at 13:02 -0700, [EMAIL PROTECTED] wrote:
  Hi,
  Can you please tell me where can I find rpm of GTK
  libraries for Red hat 4?
 
 as root, run /usr/sbin/up2date -u gtk2-devel

Actually that is up2date -i

 
 That will automatically install all the proper rpms.
 
  
  Thank you.
  
  __
  Do You Yahoo!?
  Tired of spam?  Yahoo! Mail has the best spam protection around 
  http://mail.yahoo.com 
  ___
  gtk-list mailing list
  gtk-list@gnome.org
  http://mail.gnome.org/mailman/listinfo/gtk-list
  
 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: rpm of GTK libraries for Red hat 4

2006-04-17 Thread Michael L Torrie
On Mon, 2006-04-17 at 13:02 -0700, [EMAIL PROTECTED] wrote:
 Hi,
 Can you please tell me where can I find rpm of GTK
 libraries for Red hat 4?

as root, run /usr/sbin/up2date -u gtk2-devel

That will automatically install all the proper rpms.

 
 Thank you.
 
 __
 Do You Yahoo!?
 Tired of spam?  Yahoo! Mail has the best spam protection around 
 http://mail.yahoo.com 
 ___
 gtk-list mailing list
 gtk-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-list
 

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Refreshing the progressbar

2006-04-12 Thread Michael L Torrie
On Wed, 2006-04-12 at 05:16 +0100, Sandy K wrote:
 Hello all,
 I am using the probress bar to show the progress
 of some event. Initially i have some text in the
 progress bar. After the event is complete, i change
 the text on the progress bar.. But it is not getting
 changed...
 
 But once i minimise the window and then maximise it,
 the text on the progress bar is changed...
 
 Is there any way i can change the text on the
 progressbar automatically?

Are you using threads by chance?

 
 Thanking You
 Sandy
 
 
   
 __ 
 Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

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


  1   2   >