PHP GTK and Glade questions

View: New views
4 Messages — Rating Filter:   Alert me  

PHP GTK and Glade questions

by Jiří Němec :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

Sorry about my newbie questions but I have not found answers.

1) I need something like confirm window known from JavaScript (user chooses if execute or do not execute an action). Is this kind of windows in PHP-GTK?

2) In my application there is a window where program settings will be. Is there some kind of window which has no maximize and minimize icons (only close icon) in the upper right corner? I would like to window does not appear in windows status bar. I tried to set "skip_taskbar_hint" and "skip_pager_hint" properties to true, but window still appears in the status bar. Why?

3) I need to choose two paths in a local drive. First to concrete file and second to a concrete directory. These paths need to be mentioned in input text boxes after user these paths selects. I would like to know what components use to select this file and directory.

4) This code opens new window where user chooses settings. How to close this window? (but main window needs to be still open).

$this->glSett   = &new GladeXML($this->mProgramPath.'/'.$this->mGladeGui, 'settingWindow');
$this->dlgSett = $this->glSett->get_widget('settingWindow');      
$myClassInstance = new MyClass();
$this->glSett->signal_autoconnect_instance($myClassInstance);

Thank you for your help.



--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: PHP GTK and Glade questions

by Anant Narayanan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

> 1) I need something like confirm window known from JavaScript (user  
> chooses if execute or do not execute an action). Is this kind of  
> windows in PHP-GTK?

http://gtk.php.net/manual/en/gtk.gtkdialog.php

> 2) In my application there is a window where program settings will  
> be. Is there some kind of window which has no maximize and minimize  
> icons (only close icon) in the upper right corner? I would like to  
> window does not appear in windows status bar. I tried to set  
> "skip_taskbar_hint" and "skip_pager_hint" properties to true, but  
> window still appears in the status bar. Why?

I think creating a GtkDialog and setting it as modal will not make it  
appear in the status bar, but I'm not sure :)

> 3) I need to choose two paths in a local drive. First to concrete  
> file and second to a concrete directory. These paths need to be  
> mentioned in input text boxes after user these paths selects. I  
> would like to know what components use to select this file and  
> directory.

http://gtk.php.net/manual/en/gtk.gtkfilechooser.php
You can use either a GtkFileChooseButton, GtkFileChooserDialog or  
directly embed a GtkFileChooserWidget.

> 4) This code opens new window where user chooses settings. How to  
> close this window? (but main window needs to be still open).
>
> $this->glSett   = &new GladeXML($this->mProgramPath.'/'.$this-
> >mGladeGui, 'settingWindow');
> $this->dlgSett = $this->glSett->get_widget('settingWindow');
> $myClassInstance = new MyClass();
> $this->glSett->signal_autoconnect_instance($myClassInstance);

Sounds like you're using PHP-GTK 1... you don't need the '&' anymore.  
The window can be closed by sending the 'destroy' signal to it. But  
more likely, you just want to hide the window: $this->dlgSett->hide();

--
Anant


--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: PHP GTK and Glade questions

by Jake Cobb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Anant Narayanan wrote:
>> 2) In my application there is a window where program settings will
>> be. Is there some kind of window which has no maximize and minimize
>> icons (only close icon) in the upper right corner? I would like to
>> window does not appear in windows status bar. I tried to set
>> "skip_taskbar_hint" and "skip_pager_hint" properties to true, but
>> window still appears in the status bar. Why?
>
> I think creating a GtkDialog and setting it as modal will not make it
> appear in the status bar, but I'm not sure :)
That is correct at least in Windows XP and KDE 3.5 (on X11, Linux).
Don't forget to set your main window as the transient parent or the
modal dialog can get lost behind it while blocking most input to it:

$this->dlgSett->set_transient_for($this->wndMain);


-Jake Cobb

--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: PHP GTK and Glade questions

by kksou :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jiří Němec wrote:
1) I need something like confirm window known from JavaScript (user chooses if execute or do not execute an action). Is this kind of windows in PHP-GTK?
Hi,

If you need a sample code for this, here're two:

How to setup a dialog box - Part 2 - simple yes no dialog?
http://www.kksou.com/php-gtk2/articles/setup-a-dialog-box---Part-2---simple-yes-no-dialog.php

How to setup a dialog box - Part 4 - non integer response id?
http://www.kksou.com/php-gtk2/articles/setup-a-dialog-box---Part-4---non-integer-response-id.php

Regards,
/kksou