Re: Many questions

2011-03-05 Thread Alexander Nagel
Am Sat, 05 Mar 2011 01:58:06 -0500
schrieb Jacques Pelletier jpellet...@ieee.org:

 Hi everybody,
good morning,
 
 I have several questions:
 
 1) How do we use the GThreadedSocketService and how do we specify the
 function to run when the connection is established?
 
 I'm using these function in a GUI application (see protocoltool on 
 sourceforge); when the connection is made/closed, the GUI's controls
 are enabled/disabled.
 
 2) Can an application load a linux kernel module? For example, my
 application may need i2c drivers. Does glib/gtk/gnome have anything
 to load kernel modules? How can it be done?
yes they can. The program modprobe does this. I just did a strace of
modprobe when it load a module and discovered init_module
manpage: http://linux.die.net/man/2/init_module
Perhaps you read the source code of modprobe for more details.

 
 3) Now, for unrelated questions, what are the hook functions used
 for? They look interesting, but being an amateur programmer, I have
 no idea of the context where they may be used. Are they useful in an
 user application?
They are a sort of callback functions. A nice example are 
gtk_about_dialog_set_email_hook
gtk_about_dialog_set_url_hook

The hook functions get called called when the user press the email or
url link in the about dialog. Then in the hook function you can open
another program e.g. browser or emailclient.

hth
Alex
 
 4) How do we properly use the g_cancellable functions and when are
 these used? Are they useful in an user application?
 
 Thanks!
 
 JP
 
 Note: please reply to this mailing list for convenience of other
 users. 
 
 
 ___
 gtk-app-devel-list mailing list
 gtk-app-devel-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



-- 

Alexander Nagel
E-mail: alexan...@acwn.de
Homepage: 
http://www.acwn.de/
http://www.standspur-kadaver.de/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: treeview and scrolledwindow

2011-02-21 Thread Alexander Nagel
Am Mon, 21 Feb 2011 23:16:09 +0100
schrieb Colomban Wendling lists@herbesfolles.org:

 Le 21/02/2011 23:06, Alexander Nagel a écrit :
  Hi,
  
  i have a question about treeview. Do i need to add a treeview in a
  scrolledwindow? I always did it this way but it seems to work
  without it. Which way is the better one? I would like to hear your
  suggestion/opinions.
 If you don't pack it in a scrolled window, it will (obviously) never
 have scollbars, so it'll use it's full size in the
 screen/parent-window/whatever.
And for what purpose do i need the functions
gtk_tree_view_set_hadjustment or
gtk_tree_view_set_vadjustment ?
They don't return the adjustment from the scrolledwindow. I've test that
If i want to scroll the scrolledwindow i have to use
gtk_scrolled_window_set_vadjustment.

 
 So in general, you want to pack it in a scrolled window, but you're
 not strictly forced to do so.
yes, agreed
Alexander

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



-- 

Alexander Nagel
E-mail: alexan...@acwn.de
Homepage: 
http://www.acwn.de/
http://www.standspur-kadaver.de/
___
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 connect the gnome aplication(gtk+) to database

2011-02-19 Thread Alexander Nagel
Am Sat, 19 Feb 2011 03:22:52 -0500
schrieb angel kingdom angelkingd...@gmail.com:

 HI,
 i am working on a application(project Gutenberg ) which is written in
 gtk+ and i want to connect this application with database server to
 store dictionary.i am having the Dictionary in xml format.
 So,please guide me or give me a link of how to do this work.
 I am using ubuntu 9.04
 And for database i am using the postgresql..

Hi,

install the libpq-dev package. (At least it's called in Debian Squeeze
libpq-dev, I guess it is same in Ubuntu) In this package you find a
program called pg_config which prints out the compile options you need
to compile against it. You have to add this infos in your
configure /makefile scripts (or whatever you use)

hth
Alex

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



-- 

Alexander Nagel
E-mail: alexan...@acwn.de
Homepage: 
http://www.acwn.de/
http://www.standspur-kadaver.de/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


gtkbuilder and combobox

2011-02-18 Thread Alexander Nagel
Hi,

i've created a GUI with Glade and saved it as a gtkbuilder file. There
is also a combobox with a liststore as the desired model. I have filled
the liststore with column type 'gcharray' and filled it with data. 
But the combobox is empty. What did i miss?

regards
Alex

-- 

Alexander Nagel
E-mail: alexan...@acwn.de
Homepage: 
http://www.acwn.de/
http://www.standspur-kadaver.de/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: gtkbuilder and combobox

2011-02-18 Thread Alexander Nagel
Am Fri, 18 Feb 2011 23:59:21 +0100
schrieb Alexander Nagel alexan...@acwn.de:

 Hi,
 
 i've created a GUI with Glade and saved it as a gtkbuilder file. There
 is also a combobox with a liststore as the desired model. I have
 filled the liststore with column type 'gcharray' and filled it with
 data. But the combobox is empty. What did i miss?
 
 regards
 Alex
 

Hi again,

I have just found this video
http://www.youtube.com/watch?v=Z5_F-rW2cL8

problem solved :-)

sorry for the noise
Alexander


-- 

Alexander Nagel
E-mail: alexan...@acwn.de
Homepage: 
http://www.acwn.de/
http://www.standspur-kadaver.de/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GTK/GDK equivalent to UpdateWindow() ?

2010-07-04 Thread Alexander Nagel

Hi,

i'm using gtk_events_pending to realize this.

HTH
Alexander

Am 04.07.2010 15:38, schrieb John Emmas:

Anyone who's familiar with the MS Windows API will know that it contains a 
function called UpdateWindow().  A call to UpdateWindow() forces the specified 
window's client area to be repainted immediately (i.e. bypassing any other 
messages or operations that may be pending for the window).  Is there any 
equivalent functionality within GTK+?

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


--

Alexander Nagel
E-mail: alexan...@acwn.de
Homepage:
http://www.acwn.de/
http://www.standspur-kadaver.de/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: How can I programatically activate a GtkRadioToolButton?

2010-04-02 Thread Alexander Nagel

hi,
this should work with
gtk_toggle_tool_button_set_active (...)
regards

lindl...@cox.net schrieb:

I have a tool bar containing several GtkRadioToolButtons. Clicking on them 
works fine. However, I'm trying to figure out how I can activate one of them 
programatically.

My first guess was to do
gtk_widget_activate(GTK_WIDGET(radiobutton));
but that didn't work; gtk_widget_activate returned FALSE, and no clicked 
signal was emitted.

I've looked over the other available functions, and nothing strikes me as the 
obvious choice here. Any suggestions?
___
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


gtktreeview question

2010-02-13 Thread Alexander Nagel

Hi,

I have a working gtktreeview in a scrolledwindow and i can scroll by 
mouse and even the iteration trough the list works, but i can't scroll 
automatically with this code snippet:


path = gtk_tree_model_get_path (GTK_TREE_MODEL (store), itern);

gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (tree), path,
gtk_tree_view_get_column (GTK_TREE_VIEW (tree), 0), TRUE, 0.5, 0.0);

gtk_tree_view_set_cursor (GTK_TREE_VIEW (tree), path,
gtk_tree_view_get_column (GTK_TREE_VIEW (tree), 0), FALSE);

gtk_tree_path_free (path);

What did I miss?
Any ideas?
Alexander
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



tree view question / hightlighting rows

2010-01-24 Thread Alexander Nagel

Hi,

i have a treeview which displays a list of filenames in one column and 
other things in other columns. I can iterate successfully through the list.
How can I highlight the current row? With highlight I mean that the 
row looks like selected by the user.
My next question/problem then is: if the list is longer than the current 
scrolledwindow, how can I autoscroll the hightlighted row is always 
visible to the user?

Hope you understand what I mean.
bye
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: tree view question / hightlighting rows

2010-01-24 Thread Alexander Nagel

Hi,

and thanks for your quick response. I have searched the archive, it 
seems I just overread it. It's hard to search for something but you 
don't know what to look for.  Sometimes one need just a hint to the 
correct function.


thanks
Alexander

Carlos Pereira schrieb:

Alexander Nagel wrote:

Hi,

i have a treeview which displays a list of filenames in one column and 
other things in other columns. I can iterate successfully through the 
list.
How can I highlight the current row? With highlight I mean that the 
row looks like selected by the user.
For example, this code selects the first row, exactly as if the user had 
clicked with the mouse:


GtkWidget *treeview;
GtkTreeSelection *selection;
GtkTreeModel *model;
GtkTreeIter iter;

selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview));
gtk_tree_model_get_iter_first (model, iter);
gtk_tree_selection_select_iter (selection, iter);
My next question/problem then is: if the list is longer than the 
current scrolledwindow, how can I autoscroll the hightlighted row is 
always visible to the user?

Hope you understand what I mean.
I am almost sure this was already discussed (several times) in this 
list... did you look into the arquives?

Carlos

bye
___
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: Is there a standard/offical gtk+ opengl library for game programming?

2006-11-19 Thread Alexander Nagel
Zhang Yang schrieb:
 I want to program a game for linux desktop. I want to use gtk+ so I need
 a opengl libray to corporate with gtk+. I googled and found gtkgl,
 GtkGLExt,OGLTK and SDL can be used. 
 
 Which one should I use? And another question.Is there a 3d design tool I
 can use under linux? like 3dMax under windows?
 
 
 Thank you!
I don't know if there is a standard/official ogl lib.
But for example http://sourceforge.net/projects/truevision uses 
GtkGLExt. As design tool i suggest blender, but its difficult to 
use/learn IMHO. wings3d is perhaps an alternative for small projects.

greets
Alex

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


filechooserdialog

2006-01-31 Thread Alexander Nagel
Hi all,
i use GtkFileChooserButton/GtkFileChooserDialog in my app and it seems
that the user can choose only files OR directories. Is there a way to
let the user select both?

greets
Alex


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


Re: howto mix gtk and network

2005-12-10 Thread Alexander Nagel
Am Fri, 09 Dec 2005 15:24:12 +0100 schrieb Vivien Malerba:
 
 I use the GNet library and it works fine and integrates easily in the main 
 loop
 http://www.gnetlibrary.org/
 
 Vivien
Thanks you very much. That's what i need.
Even with md5 and sha.
Alex


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


howto mix gtk and network

2005-12-09 Thread Alexander Nagel
Hi,
i plan to program a little game which also should playable over network
and i need a some ideas for the beginning.
I know the network basics.
For example at the start of the game one player act as a server chooses
the map and the number of max. players and other players can join.
(Like in CC Generals or HW2)
So what i need is a function which polls regularly every 0.5 second or so
at the given port.

Any ideas are welcome

Alex


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


Problem or Bug??

2005-11-08 Thread Alexander Nagel
Hi all
i have a normal combobox created with
gtk_combo_box_new_text 
and filled it with text with
gtk_combo_box_append_text
works fine.
Now i have the bug like
http://bugzilla.gnome.org/show_bug.cgi?id=302696
so i try to find another solution.

Now i have an gchar* array with the text to be insert into the combo_box.
So i use gtk_combo_box_get_active to retrieve the current selected and
return array [selected] but it returns always -1 which means nothing is
selected even with gtk_combo_box_set_active (combo_box,3).

Any ideas/help?
Thanks

Alex

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


Re: strange problem with radiomenuitem

2005-10-28 Thread Alexander Nagel
Am Thu, 27 Oct 2005 16:42:59 +0200 schrieb Stefan Kost:

 Hi
 Alexander Nagel wrote:
 Hi all,
 i created some radiomenuitem with this.
 
 string tmp;
 for (int i = 0; i10;i++)
 {
  ostringstream outStream;
  outStream  i;
  tmp = Gruppe  +outStream.str();
 
 char tmp[10]; // length of Gruppe xx
 for (int i = 0; i10;i++)
 {
sprintf(tmp,Gruppe %d,i);
 
 the're a thousand more ways to do it (e.g. to avoid copying the 'Gruppe' 
 string 
 in there again and again).
 
Yup indeed much easier
Thanks
Alex


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


strange problem with radiomenuitem

2005-10-27 Thread Alexander Nagel
Hi all,
i created some radiomenuitem with this.

string tmp;
for (int i = 0; i10;i++)
{
ostringstream outStream;
outStream  i;
tmp = Gruppe  +outStream.str();
Widgets_MainWindow.menugroupitems[i] = 
gtk_radio_menu_item_new_with_label (Widgets_MainWindow.GroupList, tmp.c_str());
gtk_menu_shell_append (GTK_MENU_SHELL (Widgets_MainWindow.menugroups), 
Widgets_MainWindow.menugroupitems[i]);
Widgets_MainWindow.GroupList = gtk_radio_menu_item_get_group 
(GTK_RADIO_MENU_ITEM (Widgets_MainWindow.menugroupitems[i]));
gtk_widget_add_accelerator (Widgets_MainWindow.menugroupitems[i], 
activate, Widgets_MainWindow.accel_group, gdk_keyval_from_name 
(outStream.str().c_str()), GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
gtk_widget_show (Widgets_MainWindow.menugroupitems[i]);
g_signal_connect ((gpointer) Widgets_MainWindow.menugroupitems [i], 
activate, G_CALLBACK (on_menugroup_items_activate), (gpointer) i);
}

(don't laugh about the stream thing. If someone could give me a hint to
make that better would be great.)

and this is the callback:
void on_menugroup_items_activate (GtkObject *object, gpointer user_data)
{
cout  Gruppe   (int) user_data  endl;
}

So the callback just print the number of the chosen group.
And this work.
But
1. During compilation i get a warning about
'cast to pointer from integer of different size'
for the g_signal_connect line. How can i avoid this?

2. It is normal that the callback is called twice?
For example if group 3 is marked and i change to 5 i get
Gruppe 3
Gruppe 5
then marking group 9
Gruppe 5
Gruppe 9
Is that normal?

3. When i choose group 1 the callback always produces
Gruppe 1
Gruppe 0
regardless from the previous group.
Why?


any ideas would be much appreciated.. 

regards
Alex


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


drawing area and event order

2005-10-07 Thread Alexander Nagel
Hi everybody,
i have a drawing area in my application and conncted following signals
realize, unrealize, configure_event and expose_event.
And it works...

The code:
Widgets_MainWindow.drawingarea1 = gtk_drawing_area_new ();

GTK_WIDGET_SET_FLAGS (GTK_WIDGET (Widgets_MainWindow.drawingarea1),
GTK_CAN_FOCUS); 

gtk_widget_show (Widgets_MainWindow.drawingarea1);

gtk_widget_add_events (Widgets_MainWindow.drawingarea1,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_BUTTON_MOTION_MASK);

gtk_table_attach
(GTK_TABLE(Widgets_MainWindow.table1),Widgets_MainWindow.drawingarea1, 1,
2, 1, 2,(GtkAttachOptions)(GTK_EXPAND | GTK_FILL), (GtkAttachOptions)
(GTK_EXPAND | GTK_FILL), 5,5);

The events are properly connected, that works for sure.

I thought the realize event is the first event raised, but it isn't. The
first one is configure_event. And it doesn't matter in which order the
code is. 

I want to ini a class in the realize event.

I just tried 
gtk_widget_realize (Widgets_MainWindow.drawingarea1);

before the 
gtk_widget_show (Widgets_MainWindow.drawingarea1);

but then no realize event occurs.

Why is that??
And which event is really the first one?

Any help is much appreciated

Alex


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