Page 1 of 1

GtkDialog3 questions

Posted: Thu 18 Mar 2010, 19:09
by kkevnob
I need help.
How do I make an undecorated window with gtkdialog?
Is there any way of making the gtkdialog window appearing where the mouse is?
I thought about a program that tells you where the pointer is and giving gtkdialog that position.
Another thing:
Can I put icons in a table? like in trees
thanks and sorry about my bad english

Re: GtkDialog3 questions

Posted: Thu 18 Mar 2010, 20:53
by seaside
kkevnob wrote:I need help.
How do I make an undecorated window with gtkdialog?

Put

Code: Select all

decorated="false" 
in the window tag [/b]

Is there any way of making the gtkdialog window appearing where the mouse is?
I thought about a program that tells you where the pointer is and giving gtkdialog that position.

You can use the command "getcurpos" and assign the X Y position to the "Geometry" variables


Another thing:
Can I put icons in a table? like in trees

Yes, see the Gtk examples and lots more info in the "Gtk tips" section and other posts with gtkdialog in the heading

thanks and sorry about my bad english
Cheers,
s
[EDIT: sorry - not sure about Tables and icons]

Posted: Thu 18 Mar 2010, 22:10
by 8-bit
If you have not installed devx for your version of Puppy, do so.
Then navigate to /usr/share/doc/gtgdialog3/examples.
There you will find a lot of example programs including a table type on gtk-icons.

Posted: Thu 18 Mar 2010, 23:55
by kkevnob
Thanks!
I don't know yet if the tables support icons. If I know I'll edit this post :wink:

file:///root/MSG

Code: Select all

#!/bin/bash
MSG=`expr GtkDialog + Bash`
echo $MSG
exit 0
Term

Code: Select all

$: ./MSG
Wonderfull tiny programs
$:
jejeje

Posted: Fri 19 Mar 2010, 00:02
by potong
kkevnob wrote:
Is there any way of making the gtkdialog window appearing where the mouse is?
Yes, again its an attribute tag for the windows directive:

Code: Select all

<window window-position="2">
Here is the url to study http://library.gnome.org/devel/gtk/stab ... w-position if you follow GtkWindowPosition
it will take you to "enum GtkWindowPosition".

Code: Select all

typedef enum
{
  GTK_WIN_POS_NONE,
  GTK_WIN_POS_CENTER,
  GTK_WIN_POS_MOUSE,
  GTK_WIN_POS_CENTER_ALWAYS,
  GTK_WIN_POS_CENTER_ON_PARENT
} GtkWindowPosition;

Window placement can be influenced using this enumeration. Note that using GTK_WIN_POS_CENTER_ALWAYS is almost always a bad idea. It won't necessarily work well with all window managers or on all windowing systems.

GTK_WIN_POS_NONE
	No influence is made on placement.

GTK_WIN_POS_CENTER
	Windows should be placed in the center of the screen.

GTK_WIN_POS_MOUSE
	Windows should be placed at the current mouse position.

GTK_WIN_POS_CENTER_ALWAYS
	Keep window centered as it changes size, etc.

GTK_WIN_POS_CENTER_ON_PARENT
	Center the window on its transient parent (see gtk_window_set_transient_for()).
Any enum can be replaced by an integer number (starting from zero) in the attribute tag
So an alternative way to center the window (gtkdialog3 -c) is to use

Code: Select all

<window window-position="1">
HTH

Potong

Posted: Fri 19 Mar 2010, 00:13
by kkevnob
Thanks once again
I'm making an standalone app menu.
I've almost done it.
I started it two days ago :D
Now it shows all the apps subdivided in categories.
One of the problems I've is that tree is not as fast as table.
But I still don't know how to put icons on it :?
Also not all icons are shown.
It only recognizes the icons that are in the current gtk icon theme.
If you know a way of choosing diferents icons (for ex. from a file that is in /usr/share/pixmaps) from a list that is getted from an <input> tag, please tell me.
Anyway, thanks for your answers :D

Posted: Fri 19 Mar 2010, 00:15
by kkevnob
Oh I almost forgott
How can I make the window dissapear if it loses focus?
I'm reading something about "gtk_window_get_focus ()"
but I don't know how to call gtk functions from gtkdialog + bash.. is it posible?
Thanks,

Posted: Tue 06 Apr 2010, 20:20
by technosaurus
almost all of your questions are answered here: http://www.murga-linux.com/puppy/viewtopic.php?t=38608

there is also gtk-server if you prefer