Submitted by UnTouchAble on Wed, 27/04/2005 - 04:12.
( categories: Programming )

salamo 3alekom

in my graduation project i've stuck in this problem in win32 there's a function called FindWindowEx(....)

by using the window title or button title ... i could get a handle to this widget(using gtk language)

when passing null i could get the controls contained in certain window

for non win32 programmer windows OS treat every thing in terms of window and child window So button,labels, ..... treated as child windows .

the problem is when i need to do that in linux i already do a function which simulate a FindWindow but it could find only the main window not widget inside it by using xlib directly but what about widgets .....

could any one help at least in how gtk ,qt or tk treat widget inside it

i think motif use the same concept used by win32 then what about the others

ofcourse u need to know what is this ??? the app is Gui testing tool but no unit testing which mean the GuiTester is separated from the program under test not like juint or marathon or other stuff

REGARDs


MohammedSameer's picture
Submitted by MohammedSameer on Wed, 27/04/2005 - 13:53.

In GTK when you click on a button for example, the callback is passed this button as the 1st argument and so...

If you know that you'll need a widget, Then use g_object_set_user_data() so you can get it after that.

If you give me details about your gtk project I can help you more!


-- I was known as Uniball!
WWW: http://www.foolab.org/
Quote "c u next life time then when i come back as a mug of tea :P"


Submitted by UnTouchAble on Wed, 27/04/2005 - 21:14.

Salamoo 3alekom

simply i want functions to simulate the behavior of FindWindow

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/findwindow.asp

and FindWindowEx

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/findwindowex.asp

the first one already done using xlib directly using a combination of two function XQueryTree(),XFetchName() the problem in the second one u know that xlib make no sense to controls inside a window

the step of porting it to linux is optional but actually i want to make it because i don't like using windows in my everyday work the project we worked on excepected to be multiplatform so for OS dependent tasks we should create module for every OS and use the right one at the right time windows modules completed but linux modules far from it

Uniball u r my only hope :'( save me from windows :'(

MohammedSameer's picture
Submitted by MohammedSameer on Thu, 28/04/2005 - 02:38.

Have a look at any glade generated code. in support.c there's a function:

GtkWidget* lookup_widget (GtkWidget *widget, const gchar *widget_name);
/*
 * This function returns a widget in a component created by Glade.
 * Call it with the toplevel widget in the component (i.e. a window/dialog),
 * or alternatively any widget in the component, and the name of the widget
 * you want returned.
 */

I hope that this is what you want.


-- I was known as Uniball!
WWW: http://www.foolab.org/
Quote "c u next life time then when i come back as a mug of tea :P"


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.